|
lol, nevermind... i misunderstood your post
|
|
|
|
|
Here is my event handling code:
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, <br />
WPARAM wParam, LPARAM lParam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_CREATE:<br />
Init();<br />
case WM_PAINT:<br />
PaintScreen();<br />
break;<br />
case WM_CLOSE :<br />
DestroyWindow(hwnd);<br />
break;<br />
case WM_KEYDOWN:<br />
if(wParam == 13){<br />
ProcessCommand();<br />
}<br />
case WM_COMMAND :<br />
if(LOWORD(wParam) == ID_COMMAND)<br />
ProcessCommand();<br />
break;<br />
case WM_DESTROY :<br />
PostQuitMessage(0);<br />
break;<br />
<br />
<br />
}<br />
<br />
return DefWindowProc(hwnd, msg, wParam, lParam);<br />
}
This only works if the main window has the focus, so how can i check which key was pressed if the editbox (ID_EDITBOX) has the focus.
Ie so that if the user presses enter i can run the proccessing needed on it.
|
|
|
|
|
Map the EN_CHANGE notification
Rinu Raj
|
|
|
|
|
How would i go about using the EN_CHANGE notifcation?
As checking for it in the switch case does not work as the code is not executed when i key is pressed.
<br />
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, <br />
WPARAM wParam, LPARAM lParam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_CREATE:<br />
Init();<br />
case WM_PAINT:<br />
PaintScreen();<br />
break;<br />
case WM_CLOSE :<br />
DestroyWindow(hwnd);<br />
break;<br />
case WM_KEYDOWN:<br />
if(wParam == 13){<br />
ProcessCommand();<br />
}<br />
break;<br />
case EN_CHANGE:<br />
if(wParam == 13){<br />
ProcessCommand();<br />
}<br />
break;<br />
case WM_COMMAND :<br />
if(LOWORD(wParam) == ID_COMMAND)<br />
ProcessCommand();<br />
break;<br />
case WM_DESTROY :<br />
PostQuitMessage(0);<br />
break;<br />
<br />
<br />
}<br />
<br />
return DefWindowProc(hwnd, msg, wParam, lParam);<br />
}
|
|
|
|
|
case WM_COMMAND :
if(LOWORD(wParam) == EN_CHANGE)
check MSDN for details
Rinu Raj
|
|
|
|
|
you know how to exit from aplication ?
i need something like :
PostQuitMessage(125);
Bravoone
|
|
|
|
|
what kind of application ? Console ? Win32, MFC ? .NET ?
|
|
|
|
|
whats happening ?
is that one not wuiting ?
Rinu Raj
|
|
|
|
|
#include <stdlib.h>
...
exit(0);
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
in console, yes, but there are better ways otherwise. that's why i'm waiting for his answer...
|
|
|
|
|
Yes, you're right. Since he is not specific about the question, I gave a more generic answer, which is applicable into MFC/Console
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
yes mfc
and thanks all !
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: yes mfc
then Call CDialog::EndDialog(IDOK) (or IDCANCEL )
|
|
|
|
|
Or SendMessage(WM_CLOSE);
|
|
|
|
|
Hi,
I need to know if there is C or C++ code for reading and writing any image format and another source code for creating B-SPLine surface.
Thank you
|
|
|
|
|
Either you use Chris Maunder's DIBSection wrapper[^] or Davide Pizzolato's CxImage[^] (CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images), but I don't know anything for creating B-SPLine surface. Good luck!
|
|
|
|
|
Also you can use CImage class for load/save bmp,jpeg,gif,tiff
|
|
|
|
|
send function only send char*, how to send a struct.
thanks!
|
|
|
|
|
you need to write each member to a char buffer, then send that
|
|
|
|
|
Can you please explain what you really need ?
Rinu Raj
|
|
|
|
|
a struct, is finally an array of bytes. and a char* is also such a thing. the only thing to tell to send is how much bytes (chars) it will have to send, with sizeof(YourStruct).
|
|
|
|
|
...that is after he takes care of byte order issues on each member.
|
|
|
|
|
i using this method:
send(s, (char*)&my_struct, sizeof(my_struct), 0);
thanks all for help!
|
|
|
|
|
can anybody tell me which encyption technique is used for encrpting outlook.pst file
|
|
|
|
|
I am afraid that the encryption technique that you are talking about is undisclosed by Microsoft. There are no direct ways to do this. Also the PST file format of 2003 is different from that of 2002. And check this link out.
http://ask-leo.com/what_kind_of_compression_or_encryption_do_i_want_for_outlooks_pst_files.html
Mozilla thunderbird is doing it. Its open source and you may download that source and go through that too, if you are that serious.
It's kind of fun to do the impossible.
|
|
|
|