Click here to Skip to main content
15,922,533 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Julian date Pin
ky_rerun23-Feb-09 9:46
ky_rerun23-Feb-09 9:46 
GeneralRe: Julian date Pin
ky_rerun23-Feb-09 9:50
ky_rerun23-Feb-09 9:50 
AnswerRe: Julian date Pin
Garth J Lancaster22-Feb-09 22:28
professionalGarth J Lancaster22-Feb-09 22:28 
GeneralRe: Julian date Pin
Vijjuuu.24-Feb-09 20:21
Vijjuuu.24-Feb-09 20:21 
AnswerRe: Julian date Pin
Stephen Hewitt23-Feb-09 2:29
Stephen Hewitt23-Feb-09 2:29 
GeneralRe: Julian date Pin
Vijjuuu.24-Feb-09 20:23
Vijjuuu.24-Feb-09 20:23 
QuestionRe: Julian date Pin
David Crow23-Feb-09 3:23
David Crow23-Feb-09 3:23 
Questionhow to change the background colour of RichEditBox? Pin
MahaKh22-Feb-09 19:15
MahaKh22-Feb-09 19:15 
AnswerRe: how to change the background colour of RichEditBox? Pin
«_Superman_»22-Feb-09 19:27
professional«_Superman_»22-Feb-09 19:27 
GeneralRe: how to change the background colour of RichEditBox? Pin
MahaKh22-Feb-09 20:35
MahaKh22-Feb-09 20:35 
Questionlogic to count the Active X controls on same window. Pin
V K 222-Feb-09 18:51
V K 222-Feb-09 18:51 
GeneralRe: logic to count the Active X controls on same window. Pin
CPallini22-Feb-09 22:47
mveCPallini22-Feb-09 22:47 
QuestionHow to access product version of an MFC application programmatically? Pin
kapardhi22-Feb-09 18:29
kapardhi22-Feb-09 18:29 
AnswerRe: How to access product version of an MFC application programmatically? Pin
«_Superman_»22-Feb-09 18:41
professional«_Superman_»22-Feb-09 18:41 
AnswerRe: How to access product version of an MFC application programmatically? Pin
Stuart Dootson22-Feb-09 21:50
professionalStuart Dootson22-Feb-09 21:50 
QuestionDoDataExchange VS SendMessage(hDialogwnd,WM_SETTEXT Pin
ForNow22-Feb-09 15:49
ForNow22-Feb-09 15:49 
QuestionRe: DoDataExchange VS SendMessage(hDialogwnd,WM_SETTEXT Pin
CPallini22-Feb-09 22:53
mveCPallini22-Feb-09 22:53 
AnswerRe: DoDataExchange VS SendMessage(hDialogwnd,WM_SETTEXT Pin
ForNow23-Feb-09 2:14
ForNow23-Feb-09 2:14 
GeneralRe: DoDataExchange VS SendMessage(hDialogwnd,WM_SETTEXT Pin
CPallini23-Feb-09 2:17
mveCPallini23-Feb-09 2:17 
GeneralRe: DoDataExchange VS SendMessage(hDialogwnd,WM_SETTEXT Pin
ForNow23-Feb-09 12:23
ForNow23-Feb-09 12:23 
QuestionLinux junkies and programmers Pin
Michael Randolph22-Feb-09 5:57
Michael Randolph22-Feb-09 5:57 
AnswerReported as abuse. Pin
CPallini22-Feb-09 9:12
mveCPallini22-Feb-09 9:12 
GeneralRe: Reported as abuse. Pin
Perspx22-Feb-09 9:23
Perspx22-Feb-09 9:23 
QuestionCan't Activate Window C++ [modified] Pin
sogou0922-Feb-09 4:42
sogou0922-Feb-09 4:42 
Hi Guys

I have a business full screen appliection (A.exe) run in Windows 98.
I need a hotkey when the appliection is running,Press SPACE key ,Excute a Dialog based program "C.EXE".
I try to use "RegisterHotKey" function ,But the hot key does not work.
Now I try to use Keyboard hook, I create a Dialog based program "B.exe" and "B.dll",When "B.exe"
excuted,It launched hook callback function in "B.dll".

Excute Sequence :B.exe A.exe

when A.exe is running ,I press SPACE key,the hook function catch the keyboard message,
it call C.exe (use the "ShellExcute"),The window of C.exe appear.

Qustion: The window of "C.exe" isn't current active window.the window of "A.exe" is active windows yet!
I need the window of C.exe is active when it appeared.


LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
	BOOL fEatKeystroke = FALSE;
	PKBDLLHOOKSTRUCT p = NULL;
	if (nCode == HC_ACTION) 
	{
		p = (PKBDLLHOOKSTRUCT) lParam;
		switch (wParam) 
		{
			case WM_KEYDOWN: 
				if (p->vkCode == VK_SPACE)
				{
					return 1;
				}
				break;
			case WM_KEYUP:    
			
				if (p->vkCode == VK_SPACE)
				{
					ShellExecute(NULL,"open","C:\\C.exe",NULL,NULL,SW_SHOW);
					HWND h=FindWindow(NULL,"Caption of C");
					if(h) 
                                          {
                                                ShowWindow(h,SW_SHOW);
                                          }
                                          return 1;
				}
				break;	
			default:
				break;
     		}
		
	}
  	return (CallNextHookEx(glhHook,nCode,wParam,lParam));
}


void _stdcall StartKeyMask()
{
	glhHook = SetWindowsHookEx(WH_KEYBOARD_LL,LowLevelKeyboardProc,glhInstance,0);
}

void _stdcall StopKeyMask()
{
	if (glhHook!=NULL)
		UnhookWindowsHookEx(glhHook);
}


modified on Sunday, February 22, 2009 10:53 AM

AnswerRe: Can't Activate Window C++ Pin
Dr. Emmett Brown22-Feb-09 4:55
Dr. Emmett Brown22-Feb-09 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.