|
Hi, I have done this in wince, but it should be the same:
Do you have any window or is it a background process?
If you do have a window, the window has to have focus!
You should check the exact messages send in the system using the SPY tool.
Anyway, I have managed to get the hook function to work in wince, but if another application is using the hook function, at least in wince, only one application can hook the keyboard so another call to the hook function will fail.
Try to use this code and put a breakpoint after the case WM_KEYDOWN and see if the WndProc captures the WM_KEYDOWN message.
If it does that check the wparam to see the value when you press the key, you might be looking for the wrong value in wparam that belong to your specifique key press!
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
int wmId, wmEvent;
PAINTSTRUCT ps;
TCHAR szHello[MAX_LOADSTRING];
switch (message)
{
case WM_KEYDOWN:
switch(wParam){
case 0x00000031:
OutputDebugString(L"Key_1 pressed \n");
break;
}
}
This is wince style so you have to change it a bit!
Try to get focus to your application in the beginning SetFocus(hWnd)!
I hope this help?
Cheers Dani
|
|
|
|
|
How can i create a CStatusBar on a CWnd Parent Window? It doesn't seem to work when I try it.
Thanks
|
|
|
|
|
Hello,
Does anyone knows how to work with multi-column listbox, how to work with the columns and the data? any help or link is appreciated!
Thanks
|
|
|
|
|
Have you specified the LBS_MULTICOLUMN style?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I will, but only after I figure out how to deal with the columns and the data
|
|
|
|
|
Deian wrote:
...but only after I figure out how to deal with the columns...
The listbox will not have columns without that style.
Deian wrote:
...and the data
There's nothing special about the items that are inserted into a listbox when multiple columns are involved. Use the LB_ADDSTRING message in either case.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
If you want multi column please check the CListCtrl control
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Well, I wanted to avoid using the CListCtrl, and I was curious on how to make it work. I don't have documentation about the functions involved in manipulating the columns, and dealing with data in the multi-column listbox.
|
|
|
|
|
|
can anyone pls help, i wan to retrieve the RIP header information using c++, anyway to do tis? how?
|
|
|
|
|
Have you read through RFC 1058?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Can someone please help me, I am trying to program my own Html browser, i am new to VC++.
I have two problems.
1) Created a new project in VC++ using the CHTMLVIEW base class, but get error message when i delete all the File,Edit option from the IDR_MainFrame ( I dont want the option bar) "FAILED TO CREATE EMPTY DOCUMENT"
2) I imported a HTML file in the resource, Works fine using the LoadFromResource(IDR_HTML1) but i can not get the links in that page to work,(works fine in normal IE)
Is there a easy way to combine html pages with in the C++ project file??
Please ,Please help....;P
|
|
|
|
|
|
Since I am having problem using drawdragrect(can't get it to work with scrolling) I decided to draw my own draggable rectangle.
I did it with Rectangle and SetROP2(R2_XORPEN). But the problem with that is when I drag the rectangle would inverse the color thus fill the rectangle with black color. Any way around this?
I tried it with Lineto but it would also inverse the color when two line meet at the edge. I tried to set it so line wouldn't overlap but the problem with that it would actually create gap.
Now I am doing Polyline which seems to work. Is this how most people draw their draggable rectangle?
|
|
|
|
|
Hello.
i'm trying to use IOCompletionPort while connecting to servers.
i have one client program which suppose to connect to alot of servers.
i want to do to connection with IOCompletionPort mechanism.
can anyone help me with it a bit?
i need some guidelines. my connecting is alway in blocking mode.
thanks
|
|
|
|
|
I want to serialize CMyTreeCtrl. This class is derived from CTreeCtrl. Can I serialize the whole tree?
MiKE
|
|
|
|
|
I need to eliminate flickering when resizing a derived CMDIChildWnd window that displays an image (already available in memory). I can display a series of images without flickering by opening all images in memory, and painting them from there (File access is done once only). However, I can't seem to get rid of flickering when resizing.
I tried modifying the OnPaint, OnSize, and OnSizing messages, but to no avail.
Please Help
Fayez
|
|
|
|
|
Try modifying OnErase() which erases the background.
|
|
|
|
|
Thank you very much, that works perfect! BTW, I think it was the OnEraseBkgnd()
|
|
|
|
|
I have a dialog with vertical scroll bars and lots of
text and edit boxes. Any ideas on how to automatically
scroll down the dialog as the user is typing in
information? Or somehow, if the user is in a certain
edit box, that it scroll to center itself rather than
making the user scroll down?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
I'll assume you've got the scrolling working to your satisfaction. When you use the scroll bars, the contents of the dialog scroll appropriately.
DanYELL wrote:
if the user is in a certain
edit box, that it scroll to center itself rather than
making the user scroll down
You can do this by handling the EN_SETFOCUS [^] notification from the edit controls in the parent dialog. EN_SETFOCUS is sent by an edit control to its parent window (the dialog, in this case) when it receives the focus. In the parent dialog, you can use this to scroll the dialog so that the edit control is in view.
Software Zen: delete this;
|
|
|
|
|
I've imported the classes into my app and generated the MFC wrapper classes from the file "MPNA81.TLB". All the classes are there, but I don't know how to put a map control on my dialog. I tried using just the mappoint activex control, but this doesn't have all the functionality I need. I've seen examples where the typelib is used, but then that code instatntiates the application object. I just want the map displayed on my dialog so that I can make routes and place markers at the appropriate stop. Is there a way to do this without opening the whole MapPoint app? Any help is appreciated. Thanks in advance
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
Check out what's being displayed on this phone:
http://www.cnn.com/2004/TECH/ptech/12/27/cell.phone.viruses.ap/index.html
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
interesting....does the mean that I can program a phone using c++?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
does the mean that I can program a phone using c++?
I'm not big into telephony, but it would not surprise me one bit, especially with the newer, more powerful computer phones.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|