|
my compiler was saying.... registerDeviceNotification() undeclared.... so i search google.. n put this frm there... now i also tried without prototype.. with correct header files inclueded.. now i am not getting that error but my program is also not working..im not getting any notification.....i can do this using win32 api with winMain() as entry point in place of main().. but point is that i want my program to run in background....i can hide console using ShowWindow(hwnd,1) but i dont know how to hide top level window created in winMain()?????
bye have a nice day.....
|
|
|
|
|
$w0rdf1$h wrote: my compiler was saying.... registerDeviceNotification() undeclared
And rightly so, since registerDeviceNotification() does not exist.
$w0rdf1$h wrote: ...but my program is also not working..im not getting any notification...
Why would you expect to?
$w0rdf1$h wrote: i can do this using win32 api with winMain()...
Probably so (assuming you capitalized it correctly), since it likely has a message pump.
$w0rdf1$h wrote: i want my program to run in background...
What does that have to do with using main() in place of WinMain() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
see i found it on MSDN that function registerDeviceNotification(...,...,... )
registers for windows service that sends notification to window whose HWND is registered( passing it as a parameter)....and its a function in WIN32 API.. so y should i get a no such function exist error...
see this...
http://msdn2.microsoft.com/en-us/library/aa363431.aspx[^]
bye have a nice day.....
|
|
|
|
|
C++ is case sensitive, so registerDeviceNotification is not the same as RegisterDeviceNotification.
|
|
|
|
|
yaa i knw.... im srry i posted in forum registerDeviceNotification(..)... but i the one i used in my program is RegisterDeviceNotification(...)... u can see it in my first post....
bye have a nice day.....
|
|
|
|
|
Could you please write in proper english ? A lot of people here are not native english speaker and deciphering SMS messages is really a pain.
For your question: did you include Winuser.h ?
And, why do you want absolutely use windows API in a console application. You don't have a message loop so how could you receive windows notification messages ? David already told you so.
Why don't you simply create a Win32 app, create a window and don't show it ?
|
|
|
|
|
ohh sorry... i will take care of that in future......
Now I am using WinAPI and not using console.....
i have created a window and hide it using showWindow(hwnd,0) and this is working fine...now no need to panic... thanx....
bye have a nice day.....
|
|
|
|
|
Can anybody help me help me to remove and add Caption Bar of a dialog at runtime.
I have created a dialog through resource with a caption bar.
I want to remove completely the caption on clicking the Button1 on the dialog and add the caption bar on click of button2 on the dialog.
Though on click of Button1 the caption bar is still there but the dialog is not movable whereas when i click Button2 I am able to move the dialog on selecting the Caption bar.
Can anybody suggest the way where the caption will be completely removed and caption appears as per our requirement.
void CCaptionWndDlg::OnButton1()
{
ModifyStyle(WS_BORDER|WS_CAPTION,0);
CRect aRect;
GetWindowRect(&aRect);
::SetWindowPos(m_hWnd,HWND_TOP,aRect.top,aRect.left,aRect.Width(),aRect.Height(),SWP_NOZORDER | SWP_NOACTIVATE);
}
void CCaptionWndDlg::OnButton2()
{
ModifyStyle(0, WS_BORDER|WS_CAPTION);
CRect aRect;
GetWindowRect(&aRect);
::SetWindowPos(m_hWnd,HWND_TOP,aRect.top,aRect.left,aRect.Width(),aRect.Height(),SWP_NOZORDER | SWP_NOACTIVATE);
}
|
|
|
|
|
naveen.V wrote: ::SetWindowPos(m_hWnd,HWND_TOP,aRect.top,aRect.left,aRect.Width(),aRect.Height(),SWP_NOZORDER | SWP_NOACTIVATE);
replace with
::SetWindowPos( m_hWnd, 0,0,0,0,0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_DRAWFRAME );
|
|
|
|
|
Thanks a lot.Its Working!!!!!
|
|
|
|
|
Thanks a lot Naveen.. SWP_DRAWFRAME did the trick.
|
|
|
|
|
Naveen.R wrote: ::SetWindowPos( m_hWnd, 0,0,0,0,0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_DRAWFRAME );
FYI: SWP_DRAWFRAME can be specified in the ModifyStyle itself
- NS -
|
|
|
|
|
NS17 wrote: FYI: SWP_DRAWFRAME can be specified in the ModifyStyle itself
Ya I forgot. BTW ModifyStyle() internally does the same thing...
|
|
|
|
|
The following code will do the trick...
void CCaptionWndDlg::OnButton1()
{
ModifyStyle( WS_BORDER | WS_CAPTION, 0, SWP_DRAWFRAME );
}
void CCaptionWndDlg::OnButton2()
{
ModifyStyle( 0, WS_BORDER | WS_CAPTION, SWP_DRAWFRAME );
}
- NS -
|
|
|
|
|
Thanks a lot.Its Working!!!!!
|
|
|
|
|
SWP_DRAWFRAME can be specified in the ModifyStyle itself. So no need to call SetWindowPos explicitly. See the MSDN documention for more details.
- NS -
|
|
|
|
|
... or supported MIME-Types?
I try to code a tiny Multimedia-App (which also uses DirectShow). For error handling, i need to know something about the capabilities of the desired Viewer (supported Audio- / Videocodecs). Any idea, how to get a list of installed codecs on the local machine? I dont know where to look :-|
Hints are very welcome :-|
|
|
|
|
|
I think you should be able to know installed software (i.e. codecs) through browsing in the registry. I can help you much more, bit if you look "registry" in the forum you will find a lot of interestan messages that maybe give you ideas.
hope it helps.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi,
I need a timeline control panel like Macromedia's Flash or Adobe Premier. I did not find anything in the Web.
Where can i find such o control Free or Commercial ?
Regards,
sdancer75
|
|
|
|
|
if you can spell out your actual requirement, then i can develop one such for you.
i love to develop active X controls.
|
|
|
|
|
Hello community,
i try to debug my project on dualcore machine, and if i set a breakpoint to watch the content
of my variables, for exemple CStrings, VS show only the first character???
Example:
CString csFilePath = "C:\\foldername\\file.txt";
In watch window i can see only 'C', where is the rest of csFilePath????
Thanks for any help!!!
termal
|
|
|
|
|
You might be running the unicode version.
change the following option in msdev
tools->options->Debug tab->Tick "Display unicode strings".
|
|
|
|
|
Hello,
thanks for help, you have right! For first time i think it's something with dualcore cpu,
i dont know why, i just thing so, ok, i think wrong!
with best regards
termal
|
|
|
|
|
in what is this related to the multicore architecture of your computer ?
|
|
|
|
|
In the debug window, you can specify ,su instead of the default value of ,s.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|