|
Thanks for the reply.
Actually I just got it to compile using the VC7.1 libs. Hurray
|
|
|
|
|
Hello all,
I've created an MFC application that has the Topmost attribute set to TRUE by default. It needs to sit ontop of the screen for easy access and other reason. Now I want to be able to give the user the otpion of turning that option on or off. I have included a way for them to do this with a checkbox. The problem is I can't figure out how to toggle this property on and off. If someone could show me how I would appreciate it much.
Thanks,
Justin
There are 10 kinds of people in those world. Those who understand binary and those who don't.
|
|
|
|
|
call SetWindowPos() with HWND_TOPMOST param to make it topmost, and HWND_BOTTOM/HWND_NOTOPMOST/HWND_TOP to remove this property.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Please do see MFC FAQ posted by Michel Dunn, In FAQ he explained how to keep your application ON TOP, or how to toggle it on/off
cheers
Balkrishna Talele
|
|
|
|
|
Thanks for the help guys I found the correct function. It was indeed SetWindowPos. However since I use VS .net 2002 the hwnd has been changed to a cwnd. I just used the cwndTopMost and cwndNotTopMost and it works like a charm.
There are 10 kinds of people in those world. Those who understand binary and those who don't.
|
|
|
|
|
Forgive me if this is a stupid question. I'm a bit of a novice.
I'd like to determine when a network provider is finished installing/initializing and ready to use. My app runs while the provider is being installed. I'm trying to loop as follows:
while(strcmp(netprovider_buf, "NetWare Services") != 0)
{
WNetGetProviderName(
WNNC_NET_NETWARE,
netprovider_buf,
&buffsize
);
}
My idea is when netprovider_buf equals "NetWare Services", I know I can execute the login and successfully login. The problem I'm experiencing is after the first call to WnetGetProviderName in the loop, if NetWare Services hasn't finish initializing, subsequent calls to WnetGetProviderName do not fill netprovider_buf even after NetWare Services does finish initializing. (Sound confusing yet?)
If I don't run my app until after I know NetWare Services is running, then it works fine.
It seems that the MPR somehow blocks the function from working if it fails to return the provider name after the first call. If I close my app after it fails and then re-run it, it does work.
This is all to help improve SLP resolution using NwDskPe http://www.veder.com/nwdskpe/
Thanks for any help
-Trey
|
|
|
|
|
This seems like an awfully "tight" loop, meaning that it is not yielding control of the CPU very often.
That aside, would the following help:
while (strcmp(netprovider_buf, "NetWare Services") != 0)
{
buffsize = size of netprovider_buf here
WNetGetProviderName(WNNC_NET_NETWARE, netprovider_buf, &buffsize);
}
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
u know
id put a timeout in that loop too just in case
and maybe a sleep(200) to yield the cpu
"there is no spoon" biz stuff about me
|
|
|
|
|
Sorry folks,
The code I posted was meant for illustration purposes. In reality I'm only calling the function every few seconds.
My actual code looks something like:
SetTimer(hWnd, timerID, 3000, NULL);
SetTimer is called in my InitInstance function and I'm handling the WM_TIMER message with:
case WM_TIMER:
if(strcmp(netprovider_buf, "NetWare Services") != 0)
{
buffsize = sizeof(netprovider_buf);
WNetGetProviderName(WNNC_NET_NETWARE, netprovider_buf, &buffsize);
}
else
{
strcpy(status, netprovider_buf);
InvalidateRect(hWnd, NULL, TRUE);
UpdateWindow(hWnd);
KillTimer(hWnd, timerID);
}
break;
I'm sure most of you have an even better way, but none of it works anyhow.
Even when I created a messagebox that would only execute the function when I pressed "OK", still nada. I think this may be a limitation in the Wnet api that I can't overcome, but hopefully I'm just overlooking something.
Thanks for the replies.
|
|
|
|
|
hello everyone.
I have trouble with creating a custom entry point. It's definition is int ExeMain() and it is part of a static library which is linked with the executable.
But when I set the entry point to ExeMain, the linker complains about an unresolved symbol to _ExeMain.
When the ExeMain function is defined directly in a cpp file of the executable it works, but not like that.
Any ideas?
Alex M.
Don't try it, just do it!
|
|
|
|
|
The entry point has to have the __stdcall calling convention and no name decoration. If you just write it as int ExeMain() , it gets name-mangled by the compiler as all C++ functions do.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?
|
|
|
|
|
oh... thanks mike!
Don't try it, just do it!
|
|
|
|
|
I have a listview in large icon mode. I need to control the image displayed when item is selected. That is, instead of the default fogging the list view provides, I want to display special "selected" image (known at creation time). Is it possible?
Also, is owner draw mode supported for not report mode?
|
|
|
|
|
I want to know if there is a way to figure out
a perticular dialog is enabe/disable. I use enable
/disable this dialog by the function "EnableWindow(FALSE/TRUE)"
,but before calling EnableWindow, I want to know if this dialog
is disable or enable to hide a bug.
Thanks in advance.
Shin
|
|
|
|
|
IsWindowEnabled() should do the trick!
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Any particular problems you want to discuss ?
have you tried coding some part of it ?
do you understand the problem at hand ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
in fact i'd like to know how to formulate the main algorithm:function main
|
|
|
|
|
Homework, eh? If you were to ask specific questions, rather than "Will you do my assignment for me?", you're bound to receive tons more help.
antoinette33 wrote:
if the plane is full and more passengers arrive specify that they can be put on a waiting list and will be assigned the next available seat in case of cancellation...
Sounds like the producer-consumer problem.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
ah ah ah that is really funny anyway i just wanted the main algorithm thx
|
|
|
|
|
humm, I dont think you will ever get the solution to this problem unless you try solving it.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
why don't u statr help me then? that will be nice what do u think?
|
|
|
|
|
Listen funny man you are taking the forum the wrong way.. PPl will not write the whole code for you. Thats ur job. If you get stuck implimenting a logic sowewhere down the line then some one may help you, its not garanteed that you will get help. But a question like this, there is little chance for you to get help, Instead ask your friend who has got the similar assignment and has done solving it.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
thanx for ur advice but u sound like death itself to mean wiht ur quote
|
|
|
|
|
antoinette33 wrote:
u sound like death itself
so smile.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|