|
yogeshs wrote: IS there any other method to get?
Find the list control handle from the open file dialog and using the GetWindowLong() funcion, get the style of list control( report, thumbnail, list etc ).
|
|
|
|
|
yogeshs wrote: SendMessage(pshell,WM_COMMAND,0x702D,0);//LINE 1
It's not related to your problem, but why are you not using ODM_VIEW_THUMBS ? It seems pointless to declare LISTVIEWCMD if you aren't going to use it.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thats Ok,But my problem is how to get VIew Type ?
I m not able to get viewtype.
|
|
|
|
|
yogeshs wrote: But my problem is how to get VIew Type ?
I m not able to get viewtype.
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All
I am using a ListBox and add Variable derive of CCheckListBox.i use a Check box that is use to select and UnSelct all items of ListBox.i handle it over ON_LBN_SELCHANGE of ListBox and Click event of Check box.
Selection and UnSelection from Checkbox working fine.
But problem occur when i use it by List box.i want to do when the all items of list box is checked then Select all Check box automatically Checked or vice-versa.
Code is here
CButton m_check;
CCeckListBox m_list1;
void CTestDlg::OnBnClickedCheckSelAll()
{
const int nSize = m_list1.GetCount();
if(m_Check.GetCheck())
for(int nItem = 0; nItem < nSize; nItem++)
{
m_list1.SetCheck(nItem,1);
m_list1.SetSel(nItem,1);
}
else
for(int nItem = 0; nItem < nSize; nItem++)
{
m_list1.SetCheck(nItem,0);
m_list1.SetSel(nItem,0);
}
}
void CTestDlg::OnLbnSelchangeListColumns()
{
int x=m_list1.GetSelCount();
int y=m_list1.GetCount();
if(x==y)
{
m_Check.SetCheck(1);
}
else
{
m_Check.SetCheck(0);
}
}
Properties setting of List Box Has String is TRUE,Owner Draw is FIXED,Selection is Multiple.
Problem is that when first time click on listbox then OnLbnSelchangeListColumns() is call and when i click on listbox on second time then OnLbnSelchangeListColumns is not call.
Plz help me
|
|
|
|
|
i used print function in my application it will print the contents of richedit control but i want to print whole dialog along with button and richedit control content in vc++,mfc.Anyone who knows this please help me.
|
|
|
|
|
Try PrintWindow[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
|
its available open source libraries are in net ....
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
thank u 
|
|
|
|
|
|
hi Raju,
in this api convert single tiff page only......
in multiple pages it's not support, thanks for any way your suggestion
|
|
|
|
|
Hi All
A few qureies regardign ListControl
I m using List Control in report view.
Hence my list control is having around 5 columns
Say for if user selects a particular row i need to collect all data from the columns..
Kindly help me
Thanks in advance!!!
Regards
Gany
|
|
|
|
|
Well, handle the LVN_ITEMCHANGED[^] notification sent by the list control and use CListCtrl::GetItemText[^] (the subitem parameter is the index of your column) to collect the texts in the columns.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi. Well.. another time when i need help. I am trying to create a map (made of MPictureBox(my class derived from CButton)) in a thread. I am creating modal window and clicking "ok" button and creating map on my main window (CDialog). When i did it without threads all worked just fine. But when i put the creation in a thread it make it all very well... BUT! created buttons don't show up in the main window! (they exists in the memory but didn't show). I was thinking that probably it's some kind of problem related to using main window with different threads so i wrote this
CRITICAL_SECTION m_cs;
BOOL result2;
if (theApp.m_hThread!=NULL)
{
::InitializeCriticalSection(&m_cs);
::EnterCriticalSection(&m_cs);
result2 = this->FieldBox.Create(FieldState,fieldid,nIDResourse, ButStyle,BtSize, lpszCaption, dwStyle, rect, pParentWnd, nID, Rotate);
FieldBox.ShowWindow(SW_SHOW);
::LeaveCriticalSection(&m_cs);
::DeleteCriticalSection(&m_cs);
}
with 0 effect. Same trouble i had when i tryed to create some dynamic objects (with "= new ..."). Somebody had same trouble? What's the problem? (When i do the same thing without any thread it all results okey).. Pls help.
|
|
|
|
|
If this is MFC then its Window Maps are created per thread and a CWnd* object in one thread is not (easily) accessible in another. So doing UI stuff in worker threads is difficult. It is much easier to do this in the main app thread, and shuffle off any lengthy non-ui processing to worker threads.
|
|
|
|
|
usually if you are using worker and if you want to update GUI, then the best you can do is, just use SendMessage or PostMessage for GUI updation. otherwise it may to crashes, hope u dont want crashes
Else the suitable solution is use of UI thread, just refer [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
Well.. thnx for the info it helped a lot. Now i am using UI-thread. And post messages to thread, etc. And it's all cool. It works. It creates the map of buttons and etc. BUT the problem hasn't been resolved. Buttons doesn't appear on the screen! They are created in memory but doesn't appear. Like i said the same trouble i had with pointers. I create pointer theApp.object = new CObject(...). Then theApp.object->Create(..) and theApp.object->ShowWindow(SW_SHOW) and it didn't show up. But if i write CObject globalobject; and then Create it, it appears correctly. I don't know how is that previously it worked with theApp.lvl = new ... but now it doesn't. But it all exists in the memory. I don't understand.
I noted that the objects actually works. I can click them, but the objects doesn't draw itselfs.
P.S. спасибо за ответ =)
modified on Monday, October 26, 2009 11:59 AM
|
|
|
|
|
I'm looking for some C++ code to let me quickly move a bitmap around a window, restoring the background as it moves. At present I capture the Window contents to a bitmap during the app initialization and in the OnPaint() I draw the this bitmap and then I draw my overlayed bitmap. I am double buffering the paint. The overlayed bitmap position moves with the mouse which invalidates the Window.
This works fine except it is too slow when the background window is large (think Windows Desktop) and the PC is slow. My guess is that redrawing the large background bitmap on every mouse move is the bottleneck. There has to be a much better and faster way to do this, but my searching hasn't found the answer I need.
modified on Sunday, October 25, 2009 5:25 PM
|
|
|
|
|
|
«_Superman_» wrote: Try writing a handler for WM_ERASEBKGND[^] and return non-zero.
Thanks, but I'm already doing that.
|
|
|
|
|
Try to redraw only parts on your window that really change instead of redrawing the whole thing.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
if the background is static, you really only need to draw the overlay at its new position and then draw the parts of the background that were uncovered when the overlay moved. there's no need to redraw the whole background.
1. the overlay's previous rect = R1.
2. the overlay's new rect = R2.
3. R3 = the bounding rect of R1 and R2.
4. alloc a bitmap of size R3
5. fill it with the appropriate chunk of background
6. draw the overlay into the temp bitmap
7. draw the temp bitmap to the screen
as long as the overlay is moving only a few pixels at a time, R3 should be just slightly bigger than the overlay size. if R1 and R2 don't instersect, you can split it into two operations: restore the background to one rect, then draw the overlay into the other - don't bother with the temp bitmap.
|
|
|
|
|
Thanks Chris, sounds like a good plan.
|
|
|
|
|
Load the image to memory and try to move it.
|
|
|
|