|
Hi,
Try using ShowWindow(SW_MAXIMIZE).
thanks
Nitheesh
|
|
|
|
|
It seems you need to SetWindowPos or MoveWindow on the WM_SIZE.
|
|
|
|
|
Hello,
I would like to stop all messages to the window taskbar. I try to use the PreTranslateMessage function and it seems that the messages to the taskbar are not sending throw this function. Do you know a way to catch the messages?
Do you know if it should be throw this function?
Thank a lot !
|
|
|
|
|
TalSt wrote: I would like to stop all messages to the window taskbar. I try to use the PreTranslateMessage function and it seems that the messages to the taskbar are not sending throw this function. Do you know a way to catch the messages?
Use GetWindowLong and GWL_WNDPROC to get a window's main procedure address and replace it with your own version using SetWindowLong .
Now messages to the window which you hooked should go via your WindowProc . Store replaced WindowProc ptr to use with CallWindowProc to do default stuff. Don't forget to replace back this ptr when your application exits!
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hello,
Can you give more details? I am not sure I understand...
How can the messages be stopped this way?
Thanks !
|
|
|
|
|
|
I assume by "window taskbar" you mean the taskbar with the "Start" button on it. This is part of "Explorer.exe". You can't expect to recieve messages from windows in another process via "PreTranslateMessage"!
Steve
|
|
|
|
|
I want to delete a empty folder present at a specified path. I am using this code for doing this:-
<pre>
CString fol_Path = _T("C:\\Program Files\\New Folder");
if(_taccess(fol_Path, 0) != -1)
{
Attributes = GetFileAttributes(fol_Path);
if(Attributes != 0xFFFFFFFF)
{
SetFileAttributes(fol_Path,FILE_ATTRIBUTE_NORMAL);
_wunlink(fol_Path);
}
}
</pre>
but my _wunlink function is returning -1 value.....
i am using unicode.....
can anbody tel me how to do this.....
thanks in advance
|
|
|
|
|
You're using a rather bizarre mixture of Win32, tchar and _UNICODE functions. I assume you have checked elsewhere that the folder you want to delete is empty, right? Also, you don't have to use GetFileAttributes() since you want to delete the folder anyway.
Most importantly, check the return code from SetFileAttributes() with GetLastError() .
If that is successful, use RemoveDirectory() and again check the return value with GetLastError() .
|
|
|
|
|
good morning everybody,
I m very new to windows mobile..... i m using CeDialer application .... I m able to call outgoing call.... now i want to implement call hold.... the msdn says to use LinrHold().... but I dont know where to use it in my code ,,,, and which parameter to pass in it....
I m using visual studio 2005 and windows mobile 6 sdk....
Thanks a lot ...
modified on Monday, April 7, 2008 3:00 AM
|
|
|
|
|
i have 2 exprted functions in a dll ( Win32 dynamiclink dll project )
void __stdcall MsgBox()
{
MessageBox( NULL , "Hello" , "" , MB_OK ) ;
}
void __stdcall MsgBox1( LPSTR a )
{
MessageBox( NULL , a , "" , MB_OK ) ;
}
//i tried following commands , the first one works but the not the secnd one, can any one tell where is the problem ?
//{
rundll32.exe mydll.dll,MsgBox
rundll32.exe mydll.dll,MsgBox1 "hi"
//}
//def file
//{
LIBRARY MyDll
EXPORTS
MsgBox
MsgBox1
//}
Thanks
modified on Monday, April 7, 2008 3:35 AM
|
|
|
|
|
nitin3 wrote: MessageBox( NULL , T , "" , MB_OK ) ;
And what is the output you're expecting from?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
sorry that was a mistake, i modified the code.
my problem is the second function MsgBox1 function does not displays the text i entered,
or its shows a message "An exception occured while trying to run "mydllfile.dll"
Thanks & Regards
|
|
|
|
|
To exploit the rundll32.exe your exported function must follow some rules, for instance the prototype must be like the following
void CALLBACK MsgBoxW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow);
then a working sample (at least, on XP it works...) will be
void CALLBACK MsgBoxW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
{
MessageBox(hwnd, lpszCmdLine, L"MyMessageBox", MB_OK);
}
with def file
LIBRARY "MyDLL"
EXPORTS
MsgBoxW @1
for a complete discussion see [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
you have eyes of vulture..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Please let me know how much bytes transfferd by putfile() function.
Is there any api avilable?
|
|
|
|
|
How to calculate how much bytes transfferd by putfile() function at any instant
|
|
|
|
|
chetanjoshi9 wrote: How to calculate how much bytes transfferd by putfile() function at any instant
you have to create system wide api hook on PutFile, please see if it could help :-
search following text in the CodeProject.com search box "system AND wide AND api AND hooking", you will find good number of article on above mentioned subject!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Please let me know how can I get the current internet speed in vc++
Is there any API available?
|
|
|
|
|
check if this could help! winnetstat[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hello everyone,
I read the code for class CComMultiThreadModelNoCS of ATL. What means,
--------------------
(Section Threading Model Support, Chapter 3 Objects in ATL, ATL Internals)
CComMultiThreadModelNoCS is designed for multi-threaded objects the eschew object-level locking in favor of a more fine-grained scehme?
--------------------
My understanding is the object designed could use other approaches other than critical section, like mutex/event to do synchronization. Not sure whether my understanding is correct?
thanks in advance,
George
|
|
|
|
|
Hello everyone,
In the ATL Internals book, one form of constructor of CComQIPtr is implemented as this,
CComQIPtr (IUnknown* lp)
{
p = NULL; if (lp != NULL) lp -> QueryInterface (*piid, (void**)&p);
}
I think there is a bug when QueryInterface fails, and the original value of member variable p is overwritten.
I found the in MSVC 2008, the implementation is,
atlcomcli.h
CComQIPtr(_In_opt_ IUnknown* lp) throw()
{
if (lp != NULL)
lp->QueryInterface(*piid, (void **)&p);
}
Seems the bug is fixed? Is it a bug in old version of ATL or a bug in the book?
thanks in advance,
George
|
|
|
|
|
George_George wrote: I think there is a bug when QueryInterface fails
I see no bug.
George_George wrote: and the original value of member variable p is overwritten.
The original variable? It's a constructor George!
When QueryInterface fails, having a null pointer, IMHO, is the expected behaviour.
George_George wrote: Seems the bug is fixed? Is it a bug in old version of ATL or a bug in the book?
The essence of the behaviour doesn't change here.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
CPallini wrote: When QueryInterface fails, having a null pointer, IMHO, is the expected behaviour.
You mean when QueryInterface fails, QueryInterface will set the input parameter pointer to null?
regards,
George
|
|
|
|
|
George_George wrote: You mean when QueryInterface fails, QueryInterface will set the input parameter pointer to null?
Yes. You know that.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|