|
I can use ON_UPDATE_COMMAND_UI if i need to disable a single menu item
My requirement is to disable all menus in a single shot,How can this be done.
Thanks
for thendral
|
|
|
|
|
Hi, I think that the only solutions is to disable each item of your menu. There isn't other way to make this. Sorry and good coding!
|
|
|
|
|
You can use ON_UPDATE_COMMAND_UI_RANGE . There are certain limitations too.
Nibu thomas
Software Developer
|
|
|
|
|
From Code Project articles i have coded a C++ DLL to be used as a global hook for C# projects. I have been successful in getting a global keyboard hook working. But when i try the same with a mouse hook, computer CPU goes to 100% and C# app gets a million messages that say the same thing. I am not the greatest C++ programmer. Am i missing something here? I think i have all the code parts needed?
Below is the code i am using (40+ lines):
#include "stdafx.h"
#include "hookdll.h"
#pragma data_seg("SHARED")
HHOOK m_mouseHook = NULL;
HWND m_hHookClient = NULL;
#pragma data_seg()
#pragma comment(linker, "/SECTION:SHARED,RWS") // linker directive
HINSTANCE m_hHookDLL = NULL;
const int GH_MOUSEOTHER = WM_USER + 4099;
BOOL APIENTRY DllMain(
HANDLE hInstance,
DWORD callReason,
LPVOID reserved)
{
switch (callReason)
{
case DLL_PROCESS_ATTACH:
m_hHookDLL = (HINSTANCE)hInstance;
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
extern "C" __declspec(dllexport) void InstallHook(HWND hWnd)
{
m_mouseHook = NULL;
m_hHookClient = hWnd;
// set mouse hook
m_mouseHook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC)MouseHookProc,
m_hHookDLL, NULL);
}
extern "C" __declspec(dllexport) void RemoveHook()
{
UnhookWindowsHookEx(m_mouseHook);
}
LRESULT CALLBACK MouseHookProc(
int nCode,
WPARAM wParam,
LPARAM lParam)
{
if (nCode >= 0)
{
PostMessage(m_hHookClient, GH_MOUSEOTHER, wParam, lParam);
}
// pass control to next hook in the hook chain
return CallNextHookEx(NULL, nCode, wParam, lParam);
}
-- modified at 6:15 Wednesday 22nd March, 2006
|
|
|
|
|
Hi,
is it possible for me to code a program in c++ to gather all URLs contained in a website/webpage?
or if not does anyone have a code to find URLs in a text file?
Does anyone have a sample code or a link that may give me information about this?
Your help will be appreciated. Thanks in advance
|
|
|
|
|
Use the following regular expression:
"<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\""
I've taken it from an example of boost regex library.
|
|
|
|
|
Thanks, but can u show me a more precise code?
|
|
|
|
|
If you haven't already done so, download the boost library. The regex library has an example ("regex_split_example_2.cpp"), that scans a file and returns a list of the URLs.
|
|
|
|
|
I have a picture control on the dialog.I want to get the color of the picture.or the color of the dialog(It's same to the picture).Note,not the bkColor of DC.
Thanks!
|
|
|
|
|
|
hi all
i had bitmaps or drawings on dialog.I want to print these bitmaps any idea how to do that. or any other method of doing this printings.
ddd
|
|
|
|
|
this[^] might come in handy.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
maybe it is some helpful to you
...
HDC m_dcPrinter=CreateCompatibleDC(CreateDC(m_Printer->pDriverName,
(LPCTSTR)lpdevmode->dmDeviceName,m_Printer->pPortName,lpdevmode));
PRINTDLG lppd;
...
...
PrintDlg(&pd);
hBitmap=LoadBitmap or LoadImage
SelectObject(m_dcPrinter,hBitmap);
StartDoc (pd.hDC, &di);
StartPage (pd.hDC);
BitBlt(pd.hDC,150,300,2100,1575,m_dcPrinter,0,0,SRCCOPY);
EndPage (pd.hDC);
EndDoc (pd.hDC);
|
|
|
|
|
I am working on a mfc application. At the time the project started no automatization support was defined for it from the wizard application. Now i want to add some automatization features . Can any one help me on this matter? Do i need to recode the whole prject ?
|
|
|
|
|
|
I have a dialog box. There's a (background) bitmap on it.I can load a (foreground) jpeg on it. Now I wanted to know if,on a new dialog , I can load a background jpeg on which i can load the foreground jpeg.
-- modified at 6:24 Wednesday 22nd March, 2006
|
|
|
|
|
You are not making any sense, rephrase the question.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hello,
I do have one doubt.
Iam at ppresent working with C programming in VC++ environment. I need to work with a DLL, is it possible to use for C coding also without any Dailog based file? or should i use in VC++ enviroment?
-- modified at 5:21 Wednesday 22nd March, 2006
|
|
|
|
|
Of course you can use DLL with VC++.
|
|
|
|
|
Hi Everyone,
How can we write the commandline instructions in VC++? For example, i want to copy Excel file from one location to another location in another place(LAN). I have a copy button in my dialog. When i press the copy button, the excel file should be copied over to another location. Is it possible to do so?
Thanks in Advance.
Chetan.
Helping others satisfies you...
|
|
|
|
|
system() if you directly use DOS commands.
otherwise, use CopyFile()
|
|
|
|
|
Thank you.
Is it possible to copy a file from one computer to other computer in a LAN using CopyFile().
Chetan.
Helping others satisfies you...
-- modified at 5:10 Wednesday 22nd March, 2006
|
|
|
|
|
looking at the MSDN[^], i think so
what you have to do for that is prepend the file name with \\<server>\ ...
|
|
|
|
|
int WINAPI function1(param);
int is the return value,function1 is teh function name,
then what does WINAPI do?
|
|
|
|
|
It's a calling convention for system functions. WINAPI expands to _stdcall .
Nibu thomas
Software Developer
|
|
|
|