|
Whenever I run some fullscreen games (not all, curiously), the Network Status and Task Manager's CPU usage icons (sitting in the systray) redraw themselves on top of the game's display every couple of seconds, creating some annoying flicker. I've noticed that this problem happens with *some* video drivers...one version will have that problem, another version won't...I usually try to keep up to date with my drivers, and the problem comes and goes. You'd think if the problem got fixed in version X, then it would remain fixed in version X+1. It seems like a crapshoot.
My solution is to uncheck the "Keep the taskbar on top of other windows" option before launching a game (and then re-check it when I exit), but having to do this every time is annoying, to say the least.
I thought I could write some little utility to toggle that option, so I could write a batch file to call it, run the game, and afterwards call the utility again to reset the setting.
My question is, how do I programmatically change that setting?
I suppose changing the taskbar's "autohide" setting would also work, so if anyone knows how to do either...?
|
|
|
|
|
See this[^] article. This should help you.
|
|
|
|
|
Interesting.
However, that's not quite what I'm after. I want to programmatically change the "Keep the taskbar on top of other windows" option, not merely display the dialog box that presents this option. I mean, ultimately, when you check/clear that checkbox, some API eventually gets called or some registry setting gets changed. This API/registry entry is what I'm after, so I can change the setting without showing some UI or involving the user.
As far as I can see, this just programmatically displays various dialog boxes.
|
|
|
|
|
Daniel Desormeaux wrote: want to programmatically change the "Keep the taskbar on top of other windows" option, not merely display the dialog box that presents this option.
Just wait a moment I can bang in something for you. I remember doing this.
|
|
|
|
|
Daniel Desormeaux wrote: However, that's not quite what I'm after. I want to programmatically change the "Keep the taskbar on top of other windows" option, not merely display the dialog box that presents this option.
Hurray Dan, Gotcha,
Msg 0x02b1 WPARAM 0x7 Taskbar always on top
Msg 0x02b1 WPARAM 0x8 Taskbar normal.
For Eg:
<br />
::SendMessage(hShellWnd, 0x2b1, 7, 0);<br />
::SendMessage(hShellWnd, 0x581, 1, 0);<br />
::SendMessage(hShellWnd, 0x550, 0, 10001);<br />
<br />
<br />
::SendMessage(hShellWnd, 0x2b1, 8, 0);<br />
::SendMessage(hShellWnd, 0x581, 1, 0);<br />
::SendMessage(hShellWnd, 0x550, 0, 10001);<br />
::SendMessage(hShellWnd, 0x579, 0, 0);
You will have to check this code. It worked for me sometime back. Hence not sure.
I got this from spy++ sometime back.
|
|
|
|
|
Cool. I'm gonna have to try this out. Thanks.
|
|
|
|
|
Daniel Desormeaux wrote: Cool. I'm gonna have to try this out. Thanks.
Set it back to it's original state once the application exits. Users hate to see their setting changed.
|
|
|
|
|
Of course. That was part of my original requirement; I certainly don't want to make the change permanent, or else I would just do it once and forget about the whole idea of writing a program... Re-read my original post.
|
|
|
|
|
Please help me,I have 2 problems.
-The first:I want to appear icon on the system tray when run my program.How do I have to do ?
-The second:When user insert a CD into CD driver.My program will be automatically communicate that event to user and show everything(files and folder)in the rootDirectory of CD in a Dialog.
-Please show me about them.
Thank you very much
|
|
|
|
|
1: Search the articles here for Shell_NotifyIcon .
2: Look up the WM_DEVICECHANGE message and any KB articles associated with it.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
Hi,
I created a simple DLL which is executed from IIS through a webpage. Could anyone one tell me why I can't create a window in this DLL. I'd like to create a window, render something on it then grab the image and send it back to the client through IIS. The moment I issue a CreateWindow call and run the dll from a browser it hangs.
Sam.
|
|
|
|
|
I have linked dynamic linked library myfunctions.lib file in my project by setting its path in Project/Settings/Link/Input. And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory.
Can any one suggest me what should do ? if I want to place that myfunctios.dll in some other folder??
|
|
|
|
|
chandni_chandrakant_maheta wrote: Can any one suggest me what should do ?
About what?
chandni_chandrakant_maheta wrote: if I want to place that myfunctios.dll in some other folder??
What other folder?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Add the folder path into the Additional Include Directories in the project settings.
« Superman »
|
|
|
|
|
chandni_chandrakant_maheta wrote: And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory.
Either one will work normally. I would suggest in the EXE's local directory, just to make sure you do not mess up any other application that might be using the same DLL (if not an internal DLL) - if you having questions about something like this, dicking around with the Windows/System directory is a bad idea.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
but my requirement is such that I need to make one folder in my project's exe's path, and I need to place myfunctions.dll in that folder. Doing so, it gives error tha "dll not found" and terminates the application.
|
|
|
|
|
I tried out this, but it works in case we want to include lib or header files. In case of dll it does not work. Still it gives me the error that "dll ot found. ReInstalling the application may fix this problem."
|
|
|
|
|
then you will need to explicitly specify the path to that folder. For example, if your application is in C:\SomePath\ and the folder containing the DLL is called Modules , you will need to pass the complete path to LoadLbrary(...) - C:\SomePath\Modules\MyLibrary.dll .
You can call ::GetModuleFileName(...) (I think) to get the complete path to the Executable, remove the executable name, and append the DLL's subdirectory and name onto it, and you have a complete path to the DLL.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I am a final year student designing some software to analyse hard discs. I am trying to perform read/write operations on an external drive connected to my computer through a usb port. I have used the CreateFile function to get a Handle to the drive, i then use this handle as a parameter in the ReadFileEx function (to read the data) but i get a message box from Windows telling me 'this program needs to close', beacause of an access violation. I believe all the permissions etc are set correctly, and would appreciate some advice. The hard disc i am attempting to read on and write to is a master disc from another computer, so it will have OS stuff FAT tables etc, and i think it may be this My Windows dosn't like. Like i said earlier this is part of my project for uni so the quicker i can get past this problem the better. Thankyou in advance. Craig.
-- modified at 10:07 Monday 22nd January, 2007
Craig
|
|
|
|
|
How are you using CreateFile() and ReadFileEx() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thankyou for your interest. Please see my reply to the other guy for the code.
Craig
|
|
|
|
|
Big CDF wrote: I have used the CreateFile function to get a Handle to the drive, i then use this handle as a parameter in the ReadFileEx function (to read the data) but i get a message box from Windows telling me 'this program needs to close', beacause of an access violation
That sounds like a problem with the memory you are reading into, as opposed to how you are opening/reading the physical drive. Permission problems rarely directly result in access violation exceptions, and are more likely to just cause function-level failures. Oh, and you are paying attention to return codes, right?
Please post the snippet that opens the drive, specifies the memory to read drive information into, and the call that does the actual read.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I think the problem is with the readfile function. I am trying to read the first byte of the disc.
<pre>
include <windows.h>
#include <winioctl.h>
#include <stdio.h>
int main(void)
{
HANDLE hDevice; // handle to the drive to be examined
char buf[8];
hDevice = CreateFile("\\\\.\\i:", // drive to open
GENERIC_READ | GENERIC_WRITE, // access to the drive
GENERIC_READ | GENERIC_WRITE, // share mode
NULL, // default security attributes
FILE_FLAG_OVERLAPPED, // disposition
0, // file attributes
NULL); // do not copy file attributes
if(ReadFileEx(hDevice,buf,1,NULL,NULL))
{
printf("%s",buf);
}
CloseHandle(hDevice);
return (0);
}
</pre>
Craig
|
|
|
|
|
Big CDF wrote: FILE_FLAG_OVERLAPPED, // disposition
Where is your OVERLAPPED structure?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|