|
Creating a dummy window is not possible in this app.
|
|
|
|
|
Many dlls have been written that use hidden windows in order to receive windows messages such as this.
Why is it not possible for you to do this within your DLL?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi,
Basically it's an explorer shell extension. Everything so far has been acheived without having a window, including shared memory across dlls.
The requirements dictate 'no windows'.
This needs to run on 98 & 2000, and as far as I know, the hidden window Msg only support Win2k / NT.
looking forward to your reply.
Carl
|
|
|
|
|
You could create your own hidden window on any Windows flavour if you wanted to.
You could question why 'no windows' is a requirement. Perhaps it is only 'no visible windows'.
Going with the stated requirement that 'no windows' are allowed. Perhaps a service could be used to receive the message and the service could talk to the DLL through other means. Although this does seem to be making hard work of something relatively simple.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi, please see latest reply to ALOK.
Kind Regards
Carl
|
|
|
|
|
I am Saying create a dummy Window in DLL not in app.
here is a little code,i thik this will help you to understand that.
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved<br />
)<br />
{<br />
lpReserved=NULL;<br />
g_hModule=(HINSTANCE)hModule;<br />
<br />
if(ul_reason_for_call==DLL_PROCESS_ATTACH)<br />
{<br />
::CloseHandle( ::CreateThread( NULL, 0,&ThreadProc, NULL, 0, NULL) );<br />
}<br />
<br />
<br />
return TRUE;<br />
}
and Thread Proc
DWORD WINAPI ThreadProc(LPVOID lpParameter)<br />
{<br />
lpParameter=NULL;<br />
<br />
WNDCLASS wndClass;<br />
<br />
wndClass.cbClsExtra=0;<br />
wndClass.cbWndExtra=0;<br />
wndClass.hbrBackground=(HBRUSH)::GetStockObject(WHITE_BRUSH);<br />
wndClass.hCursor=NULL;<br />
wndClass.hIcon=NULL;<br />
wndClass.lpfnWndProc=(WNDPROC)OEWndProc;<br />
wndClass.lpszClassName="asdsadsda";<br />
wndClass.lpszMenuName=NULL;<br />
wndClass.style=CS_HREDRAW|CS_VREDRAW;<br />
<br />
::RegisterClass(&wndClass);<br />
<br />
OEParenthWnd=CreateWindowEx(0,"sdffdsf","sdfsdf",0,200,0,500,300,0,0,0,NULL);<br />
<br />
while(GetMessage(&msg,0,0,0)<br />
{<br />
}<br />
<br />
<br />
}
this is not full code,its just logic so that you can implement Dummmy window in you DLL
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
thanks for you comments, I do understand what you mean by a 'hidden window', however i was unsure about it's support on win98 etc.
Thanks for the code frag.
I have decided to use a WH_CALLWNDPROC HOOK for this solution.
and monitoring
WM_ENDSESSION message.
Thanks very much for your help.
Carl
|
|
|
|
|
Hi,
Any idea how can i change font in treeview control ?
Thanks for reply
Regards
Alpha
|
|
|
|
|
|
Hai Frens. . .
I need to provide a multiple row selection in the MSFlexGrid used in my application.Can any one guide me how to do that. . .?
thanx
|
|
|
|
|
how do i mask an image?(certain parts of it only)
any ideas???
|
|
|
|
|
|
thanx.....
|
|
|
|
|
I`ve got kind off a complex situation here.
I have a class hierarchy that looks like
class A
class aB:public A
class aC:public A
class cD:public C
with further derived classes, but for illustrating this`ll do.
in class A I define some constants like
#define CONST_A_1 1
#define CONST_A_2 2
...
if class aB needs to I should be able to define a series of constants there that continues where the series of #defines in class A stopped.
e.g. if last const in class A was #define CONST_A_X x (where x is a number)
then CONST_aB_1 should get value x+1.
Ok this is easy I could just define in class A #define CONST_A_LAST CONST_A_X
and set the definitions in class aB like
#define CONST_aB_1 (CONST_A_LAST+1)
#define CONST_aB_2 (CONST_aB_1+1)
...
Now imagine that the constants defined in A are good enough for aC(no extra needed), but I need some more for cD...
I could define them in cD as i did in aB like #define CONST_cD_1 (CONST_A_LAST+1) and so on, but what if due to specifications I don^t have yet I will need to define a constant in aC later on? Then I will need to change the defines in class cD too (at least the first one,because I don^t want a constant with the same value in base-class)....
From the start I could define in aC something like #define CONST_C_LAST CONST_A_LAST
and use that CONST_C_LAST as a starting point in cD.
However I don^t like the above approach( although it might be the only one??)
The thing is each time I would derive a new class from one of these classes I would need to remember to define a new "CONST_..._LAST" constant (in case that I derive a class from that class and need to specify a new const).Which might lead to a lot of unused defined constants (doesn^t hurt, but I don^t li
Does anybody know how I could solve this issue here in such a way that I can remove/add new constants to a class without needing to worry about derived classes of that class. Or derive classes without having to remember adding a CONST_..._LAST if I don^t need it for that class, but still be able to derive a new class from that one and start with a correct constant without bothering base class, and in case base class suddenly needs a constant adding it there without bothering derived class.
I know sounds like a lot to ask for. But someone might know a solution....
Thanks for any insight you might provide.
Greets,
Davy
|
|
|
|
|
How can I make a CString to a int?
I have a CString with numbers let's say 30 and I need to count down that so I get to zero. I cant use a int to start with it need to be a CString. But I need to convert that CString to a int? But how can I do that?
|
|
|
|
|
use _ttoi() function
Yuvaraj N
|
|
|
|
|
Ok but how do I set up this?
|
|
|
|
|
Supps
CString ValueString=_T("30");
then
int Value=_ttoi(ValueString);
Yuvaraj N
|
|
|
|
|
|
CString str = "32";
int i;
sscanf((LPCTSTR)str, "%d", &i);
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
It can be a solution for all platforms, only you have to create a normal window - not message only - a bit more overhead, but should work.
If you want to receive a message, you need a window (WM_ stands for Window Message ) for window you need a message pump...
Or might be there will be a better way how to detect the windows shutdown, but I don't know them from the head now.
|
|
|
|
|
Can I add active GIF onto a dialogue box under Visual C++6.0? Using Window OS from Win98, Win98SE, Win2000 and WinXP.
On Visual C++ 6.0, how to I identify a user who is having what kind of privileges? (i.e admin privilege, etc)
|
|
|
|
|
hello all,
cau any one tell me, in VC++ what messege do i need to send in the button function so that when ever the user clicks the button on the dialog box which is created in an SDI application, the cursor moves up in the client area , where my button is member dialog class and object of button class
void MyDialog::OnButtonup()
{
short caps=GetKeyState(20);
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
if( (TRUE && !(keyState[38] & 1))||(!FALSE && (keyState[38] & 1)) )
{
// Simulate a key press
keybd_event( 38,0x45,KEYEVENTF_EXTENDEDKEY|0,0);
// Simulate a key release
keybd_event(38,0x45,KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP,0);
}
}
but this code dos't compelete my requirement
|
|
|
|
|
Hi,
I am working with MDI application. I want to ovverwrite ID_APP_EXIT, File->Exit menu function of Mainframe menu. When I click on this menu option or on the close icon button of Main frame, I should check for a particular condition and then allow to exit the application if condition is true or else I should not allow the user to exit.
I am able to overwrite and check the condition, but unable to close the application if condition is met. If I used PostQuitMessage(0), it's getting closed but I'm getting lot of memory leaks due to this function.
Can anyone please help me to do this?
Thanks
Madhavi
|
|
|
|
|
Try
AfxGetMainWnd()->PostMessage(WM_CLOSE);
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|