|
|
Try removing the default args of 0 from AfxCallWndProc.
|
|
|
|
|
I am doing the following things for neighbour child window updation in win32.
child window which contain listview control.
<code>
if(((LPNMHDR)lParam)->code == NM_CLICK)
{
iSelect=SendMessage(hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
if(iSelect==-1)
{
break;
}
index=iSelect;
ShowWindow(hWndinoutfiledir,SW_HIDE);
ShowWindow(hwndEncrypt,SW_HIDE);
ShowWindow(hwndSplit,SW_HIDE);
ShowWindow(hwndUpload,SW_HIDE);
ShowWindow(hwndTagEditorDlg ,SW_SHOW);
<big>::SendMessage(hwndTagEditorDlg ,IDC_HIDDEN_BTN,0,0);
</big>
UpdateWindow(hwndTagEditorDlg);
}
</code>
after click this below code is for updating child window. But it doesn't work.
LRESULT CALLBACK TagEditorProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
Utility util;
switch(message)
{
case WM_INITDIALOG:
if(_ProtectSet[index].listviewIndex==index)
{
SetDlgItemText(hDlg,IDC_EDIT_ARTIST,util.ConvertStringToWCHAR(_ProtectSet[index].artist));
SetDlgItemText(hDlg,IDC_EDIT_ALBUM,util.ConvertStringToWCHAR(_ProtectSet[index].album));
SetDlgItemText(hDlg,IDC_EDIT_YEAR,util.ConvertStringToWCHAR(_ProtectSet[index].year));
SetDlgItemText(hDlg,IDC_EDIT_COPYRIGHT,util.ConvertStringToWCHAR(_ProtectSet[index].copyright));
SetDlgItemText(hDlg,IDC_EDIT_AUTHOR,util.ConvertStringToWCHAR(_ProtectSet[index].author));
SetDlgItemText(hDlg,IDC_EDIT_GENRE,util.ConvertStringToWCHAR(_ProtectSet[index].genre));
SetDlgItemText(hDlg,IDC_EDIT_DESCRIPTION,util.ConvertStringToWCHAR(_ProtectSet[index].desc));
}
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_SAVE_TAG:
_ResideId3TagForSelectedFile(hDlg);
MessageBox(hDlg,_T("You file has been saved"),_T("encoder"),0);
break;
<big>case IDC_HIDDEN_BTN:
MessageBox(0,_T("HAY"),_T("HI"), 0);
::PostMessage(hDlg,WM_INITDIALOG,0,0);
break;</big>
}
break;
}
return FALSE;
}
can any body help me how should update my child window with null control or assigne values from object.
|
|
|
|
|
amitmistry_petlad wrote:
::SendMessage(hwndTagEditorDlg ,IDC_HIDDEN_BTN,0,0);
problem is that. you are sending the Ctrl ID in the message Field and trying to get in WM_COMMAND message!
better way of sending it is
PostMessage(hwndTagEditorDlg,WM_COMMAND,IDC_HIDDEN_BTN,0); and capturing that in WM_COMMAND wParam Parameter
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
A small clarification Alok:
you've omitted the notification code for the button which probably should be BN_CLICKED . The WPARAM parameter for the WM_COMMAND message contains both the control ID and the notification code. The code for simulating a user click on the IDC_HIDDEN_BTN should look like this:
::PostMessage( hwndTagEditorDlg, WM_COMMAND, MAKELONG( IDC_HIDDEN_BTN, BN_CLICKED ), NULL );
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: The code for simulating a user click on the IDC_HIDDEN_BTN should look like this:
offcourse.. you can also use SendDlgItemMessage!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok wrote: u can also use SendDlgItemMessage
Very true, but that call chain will eventually call ::SendMessage() which is synchronous. Perhaps the idea was to have an asynchronous implementation.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: ery true, but that call chain will eventually call ::SendMessage() which is synchronous. Perhaps the idea was to have an asynchronous implementation.
you can make SendMessage Sync call Async by using ReplyMessage Api!
|
|
|
|
|
ThatsAlok wrote: you can make SendMessage Sync call Async by using ReplyMessage Api
Umm, not exactly...
It may be that we're talking about different levels of abstraction, but the call to ::SendMessage() always block until the message is "handled".
In a single threaded situation a call to ::SendMessage() would be similar to a function call, the message will never appear in the message queue. In this situation ::ReplyMessage() has no effect since it wouldnät make any sense.
When a thread sends a message to another thread with a call to ::SendMessage() , the sending thread will block until the receiving thread has handled the message. In this situation you may call ::ReplyMessage() to release the blocked thread before returning from the message handler in the receiving thread.
MSDN says: If the message was not sent through SendMessage or if the message was sent by the same thread, ReplyMessage has no effect.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
what should i write suppose i want to pass the extra parameter in sendmessage, like passing the selected index of the listview control.
|
|
|
|
|
amitmistry_petlad wrote: like passing the selected index of the listview control.
pass it in lParam parameter
|
|
|
|
|
Hi all,
I have created a thread and would like to know when the thread is called, is that the only time that the code within the thread would be executed? Or could one call the thread again to execute the code within the thread again. Hope this makes sense ...
void TestProc(void *par)
{
printf("Just testing some stuff\n");
}
...
int valTest = 1;
HANDLE handleTest;
handleTest = (HANDLE) _beginthread( TestProc,0,&valTest);
WaitForSingleObject(handleTest,INFINITE);
...
Many thanx in advance
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Read this article to get a better understanding of how to use worker threads: clickety[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanx Roger, the link has very useful information.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi all
Can you pls help in Using Power management to Monitor UPS
Thanks & Reagrds
abhi
|
|
|
|
|
abhiramsss wrote: Can you pls help in Using Power management to Monitor UPS
Read the power management [^]section in MSDN. This section lists all the power management functions, messages, along with overview.
|
|
|
|
|
Hi
i am not understanding exactly how the bit fields implemented
if i create the following structure
struct word
{
unsigned int bit1 : 1;
unsigned int bit2 : 1;
unsigned int word3 : 16;
}
internaly how many bytes will be saved and is the 1 means 1 bit ?
|
|
|
|
|
Ayman Mashal wrote: is the 1 means 1 bit ?
yes.
so totally, your struct uses 1+1+16=18 bits, but as the lower piece of memory you can address is the byte, you will use 3 bytes (as 2 bytes - 16 bits - are too few).
so, from usins 3 unsigned ints (which are commonly, on 32 bits machines, 32 bits wide), you're saving 12-3 = 9 bytes !
|
|
|
|
|
Acutally, since the OP has declared his bitfields as int xxx : 1, it will use 4 bytes (only three will contain valid values).
If you save to a file, or even in memory, it will still consume 4 bytes.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
krmed wrote: int xxx : 1, it will use 4 bytes
the :1 notation means 1 bit, no byte
|
|
|
|
|
Obviously it means one bit. But by declaring it as
int mybitvar : 1
it will still consume 4 bytes when stored.
Maybe I don't understand why you think my reply was in error?
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
This[^] MSDN article will probably help you.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
I'm trying to create simple MDI program with splitter with two panes, the first should be TreeView (or any other ctrlview for that matter) the second one I'd like to be the FrameWnd client window, where the child windows will be present. How do I do that? (I saw the examples but all of them use all panes for views).
I guess the same result can be achieved using resizeable docked dialogbar,
but it's more complicated to implement.
thanks,
Guy.
|
|
|
|
|
hi,
How to select a item in a tree control if i know path of that particular item.
|
|
|
|
|
yuvachandra wrote: i know path of that particular item
Whats does this mean ? Is it text displayed ?
You need to traverse tree control items inorder to go to particlular node and select it.
|
|
|
|
|