|
Yes, if they "belong" to the same application. For example, if you had a view with some controls on it (e.g., listbox), and a modeless dialog atop that with an edit control, you could very easily take the contents of the edit control and post a message to the view instructing it to add the string to its listbox.
|
|
|
|
|
One solution is messages. Send a message from the source window to the destination window.
Kuphryn
|
|
|
|
|
Thanks for all your help. Got the job done.
|
|
|
|
|
Hi,
Just a general question about spinners.
How come the spinner works in the opposite direction, or at least seems to go against what seems natural? When I hit the up arrow it counts down and vice versa? Can I change that around? How do you format the edit box to allow numbers only? Set precision on the numbers? letters only?
|
|
|
|
|
Read the documentation for CSpinButtonCtrl::SetRange(). It'll tell you why and how to change the behavior.
|
|
|
|
|
cheers for that. This has always been a pain for ages, but never bothered to figure out how to change the behaviour
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
My laptop (running Windows ME) has the ability to hibernate. However, hibernation seems to fail when certain programs are running (I suspect those that make use of system timers). I want to write a piece of code to automatically close a list of programs if they are running and then effectively cause the system to hibernate. I need some help on this - I suspect that I'll have to use something like EnumWindows() to see if the programs are running, but will this pick up those that have minimised windows, or those "dormant" in the taskbar ? Also, how do I issue the call to the system to hibernate ? Apologies for the naivity !!! Thanks in advance for any help offered ! (Using MSVC++ Ver 4.0 by the way !)
Doug
|
|
|
|
|
Well I'd upgrade to WinXP if possible. ME is crap. I've never had a problem with Hibernate not working on XP.
If that isn't possible I'm sure you'll find articles here on CP which enumerate processes. Also look at sysinternals.com
There is a Win API for the Hibernate stuff. Do a search on MSDN http://msdn.microsoft.com/default.aspx[^]
You might have difficulties with such an old version of VC++!
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
hi,
How many desktop can i create with CreateDesktop() API in VC++.Is there any restriction in numbers of desktop and How many WorkStation can i create in that m/c. I want the limitation for Desktop in one machine.
I have checked with my program it is only allowing 13 desktop, can i create more desktop, Can i have more than desktop 50 by creating different workstations or like that.if any body know more about this plz post reply
I also tried to create a WorkStation and bind Desktop to it then it allowed me the 80 desktop. But i need the specify number of desktop i can create
The error i get in both condition is Error:8 (Not enough storage is available to process this command. )
Regards,
Thomas
|
|
|
|
|
Is there a system-generated event when a file is sent to print could someone include sample code ?
If I could use a system hook to listen for IRP_MJ_WRITE (Parallel Device)maybe? Any help would be appreciated.
Thanks
Anthony
|
|
|
|
|
Use FindFirstPrinterChangeNotification and related APIs - there's VB articles on my site that you should be able to change no bother
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hi,
I have an ActiveX tested OK. Now I have added a method taking a BSTR and BOOL parameters and returning void. The VC Code compiled and registered correctly. I inserted this activex in VB and when I tried to call the newly added method it gives an error "Wrong number of arguments or invalid assignment error". I don't have any clue on why this error as the Object Browser shows the method signature correctly as declared. And also I am passing the same type of parameters. Can any of you help me to solve this issue?
Thanks in Advance,
Ishwari
|
|
|
|
|
I'm developing a Win32 console app in VC++ 6.0 where I have coded a edit box which works fine... however running my console app on Windows 98, my app affects the speed of the computer.
I have tracked the problem down to my "main input loop" where my app wait for the user to press a key.
The main loop (very simple!) looks something like this :
BOOL bOK=TRUE;
int cKey;
while (bOK)
{
while (!_kbhit())
{
}
cKey = _getch();
}
So my question is : is there a "proper" way to wait for a input chars in a console app which does not slow down Windows 9x ?
Please help, thanks
|
|
|
|
|
I am not sure about what you mean with Win32 console app. Is it a Win32 application, or a console app ?
If you have the Win32 code, then just process the message loop and check for keyboard messages.
If not, I guess you can use getchar(); .
~RaGE();
|
|
|
|
|
As i wrote... It's a Win32 console app
Not a DOS app but a 32bit console application.
Edit : I tried to process the Windopw messages but since my console app does not have a Windows (HWND) handle, I can't do that ;(
|
|
|
|
|
Do the sleep() call. I have console-app based servers -- we do the same thing of a kbhit/getch loop to look for the shutdown keystroke.
With a sleep(100) this thread bears no impact on the process.... Thread priority is not a good way to do this, since the crux of the problem is that your thread is always awake and always processing.
Threads should not be wasting process time when they don't need to.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
Santa Cruz Networks
|
|
|
|
|
I used the Sleep method which worked !
Thanks guys
|
|
|
|
|
It has been a while since I've done anything like this but,
I don't think you need your _kbhit loop. _getch() will wait for a character to be pressed before executing the next statement.
This is the MSDN example
int ch;
_cputs( "Type 'Y' when finished typing keys: " );
do
{
ch = _getch();
ch = toupper( ch );
} while( ch != 'Y' );
_putch( ch );
_putch( '\r' );
_putch( '\n' );
}
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
Thanks... that seems to do the trick
However I need to do some processing in my _kbhit loop, but maybe I can find a workaround for this.
|
|
|
|
|
If you need to do some processing inside the loop, call Sleep( 1 ) at the end of each loop. That should prevent starving windows of cpu time.
n!
|
|
|
|
|
Thanks, the Sleep worked for me
|
|
|
|
|
I think _getch() has a built-in wait so you might try removing the call to _kbhit().
|
|
|
|
|
I needed some processing in the _kbhit loop but using Sleep in the loop solved the problem, thanks
|
|
|
|
|
a) you can lower the thread priority while you wait for input
b) a Sleep(20) won't hurt
c) you can *try* if MsgWaitForMultipleObjects "wakes" your thread when you input a kjey (I doubt that, though)
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Thanks
I simply added a Sleep which did the trick
|
|
|
|