in my application i want to read all the key and data values of some registry folder so i am using this RegEnumValue function but when i kept this function in for loop it is reading few values and failing in the middle..
can anybody suggest me the reason for this i attach the code i have used for this...
This code would require that InitCommonControls was called somewhere and that the appropriate library was linked. You could use the use_manifest #define to conditionally include <commctrl.h> & call InitCommonControls.
You'll need to have a preprocessor constant that's unique to each config. For this example, imagine it's debug vs. release. Debug builds have _DEBUG defined, while release builds have NDEBUG.
Right-click on the VS_VERSION_INFO resource and pick Properties. On the Condition line, enter _DEBUG.
Then make a copy of that resource, and in its properties, enter NDEBUG on the Condition line. After you set that condition, you can change the ID back to VS_VERSION_INFO, and you're done.
(This is in 2005 but it should be similar if not the same in 2008)
I am writing an application that checks the correct functionality of a keyboard.
I am doing so by overriding the PreTranslateMessage(MSG *pMsg).
In my PreTranslateMessage i am catching all the WM_KEYDOWN and WM_SYSKEYDOWN messages and read from the wparam which key was pressed .
I have 2 problems:
When pressing the start button (VK_LWIN), the start button is actually pressed and the start menu is opened. The menu is being opened even if i put a break point in the beginning of my PreTranslateMessage. I just want to know when the start button was pressed and i dont want it to open the start menu.
It seems that the print screen button doesn't generate any of the 2 messages that i process in the PreTranslateMessage. what is the window message that is generated when i press the print screen key?
Have you tried using SetWindowsHookEx() with the WH_KEYBOARD or WH_KEYBOARD_LL hook procedure? Look at the docs here.
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
// try to open an existing file
fp = fopen("test.dat", "r+b");
// if failed, then create a file
if (fp == NULL)
printf("File doesn't exist\n");
fp = fopen("test.dat", "w+b");
// if file opened/created ok continue
printf("File opened successfully.\n");
// otherwise, nick-off
// write some binary data to the file
for (i=0; i<100; i++)
fwrite(&i, sizeof(i), 1, fp);
// get length of file
fseek(fp, 0, SEEK_END);
fLen = ftell(fp);
// return file pointer to beginning of file
fseek(fp, 0, SEEK_SET);
// loop through, reading 1 long at a time from the file and printing it's value
for (i=0; i<fLen/sizeof(long); i++)
fread(&tmpValue, sizeof(long), 1, fp);
2) if you want to do it in very simple method without writing shell extension, then modify registry to add a specific menu item to shell which will execute your specified executable on clicking. Check the "Explorer Context Menu" section in this link[^].
Hi everybody, iam trying to prevent the user from resizing, maximizing and minimizing a FormView window by using : OnSize and OnSizing functions, but it did not work? can somebody help? Thansk in advance
Last Visit: 31-Dec-99 18:00 Last Update: 24-Jul-21 4:15