|
durban2 wrote: CMainDlg2 dlgModal; // modal
m_sWorkModeless.Format(L"row = %d",dlgModal.row);
MessageBox(m_sWorkModeless);
In that code sample, the modal dialog's done no work, so its row member will still be as constructed - maybe you need a dlgModal.DoModal(); before you read the row?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello,
I have embedded an Edit box in my dialog during design time with styles 'Multiline', 'Horizontal
Scroll' and 'Vertical Scroll'.
During runtime, I set text to this edit box with SetWindowText. The set text extends the
dimensions of the edit box and so I want the text to be wrapped dynamically.
How could I achieve this ?
Note : I also tried changing the styles to 'Auto HScroll',
'Auto VScroll', etc.
Thanks in advance.
|
|
|
|
|
Remove the Horizontal Scroll bar and 'Auto HScroll' style....
|
|
|
|
|
Try calling CEdit:FmtLines(TRUE) on your control.
|
|
|
|
|
Hi All
How can i know exe is kill from task manager?I want to show message when exe is kill from task manager?Plz help me
|
|
|
|
|
Davitor wrote: How can i know exe is kill from task manager?I want to show message when exe is kill
So you want to know whether your application is forcefully closed from some other applications such as Task manager right ?
And you want to show some messages at that time ?
Try to map WM_QUIT[^] message in your application. You can display a message in the OnQuit function.
Sorry! I missed the first line in OP
Davitor wrote: How can i know exe is kill from task manager?
Please see the other posts from Superman,Rajesh and Naveen!
Any way I am very glad with this board where people are miserly giving votes for a helpful answer while very competitive in down voting for the mistakes...
modified on Tuesday, May 12, 2009 2:37 AM
|
|
|
|
|
No that wont help. When we kill an exe ( Endprocess ) from the task mamanger, it calls TerminateProcess(). And your process will not get any clue...
|
|
|
|
|
When the user is killing your app with the task manager, he really does want your app to die *immediately*. Not to show any messages, not to execute one more line of code. Therefore, Windows does not allow you to do such a thing.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
If you can do it outside the app that's being killed, then you can use WMI[^].
IIRC, you need to consume[^] the __InstanceDeletionEvent[^] where the TargetInstance is the process[^] that you want to monitor.
I've done this in VBScript - it's relatively easy, but in C++ it's a bit more involved...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
As said in some of the other posts, task manager will call TerminateProcess to kill the process.
But there is one thing I have noticed.
TerminateProcess takes an exit code as parameter.
You can retrieve this exit code using GetExitCodeProcess after the process is killed if you have the handle to the process.
And task manager always sets this to 1.
But again, any application can use TerminateProcess to kill a process and give the exit code as 1.
So, if you don't have a return 1; statement in your application entry function, you have a good chance of knowing that it was terminated using task manager.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
As an addition to my previous answer - here's some VBScript that will wait until the next time a process called "myprocess.exe" is deleted:
' Get a reference to the WMI service
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
' Open a WMI query for __instancedeletionevents where the target instance is a Win32_Process and
' the target instance's name (i.e. the process name) is myprocess.exe
Set colMonitoredProcesses = objWMIService. _
ExecNotificationQuery("select * from __instancedeletionevent " & _
"within 1 where TargetInstance isa 'Win32_Process' and " & _
"TargetInstance.Name = 'myprocess.exe'")
' This call will complete the next time a process called myprocess.exe is deleted.
colMonitoredProcesses.NextEvent
The equivalent in C++ would be quite a bit longer, but would do the same thing.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: The equivalent in C++ would be quite a bit manly, ...
Fixed that for ya.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Go on then, prove yourself a man by translating that bit of VBScript into C++
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
*starts typing furiously into the IDE*
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: *starts typing furiously into the IDE*
Men don't use IDEs.
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
[My articles]
|
|
|
|
|
Unless of course it is Klingon's IDE.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: Unless of course it is Klingon's IDE.
There is NOT such a thing, there is just...ehm.... Good Thread Hijacking!!!!!
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
[My articles]
|
|
|
|
|
If the user tries to close your program from the Task Manager (Applications tab) you can catch the WM_CLOSE message and handle it there.
I'm not sure that will work from the Processes tab, however.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
im makeing a program but im haveing some issus with it
i dont know how to make (search for a word) and the program will find it form a database or something
if any one can help that would be great full
|
|
|
|
|
tell us what are the issues? and till where have you reached.
|
|
|
|
|
Wiland1234 wrote: m makeing a program but im haveing some issus with it
Vague (be specific!).
Wiland1234 wrote: i dont know how to make (search for a word) and the program will find it form a database or something
From a database or from 'something'? What is 'something'?
Definitely tooooo vague.
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
[My articles]
|
|
|
|
|
I am looking to send a signal to IDE channel 2
The senario.
I am branching out and looking at robotics and have a Mini ITX (GA-PCV2) running windows xp with a number of onboard systems however i am in need of additional communication means.
I am currently using the parralel port to control 8 relays (may try and improve that number with this artical) Parallel Port Pin Control Library (PaPiC)[^] however what i would like is to be able to send a signal via the IDE channels to control a further 16 relays or more if possible.
I currently only use a singal 3.5" hdd on the ide channel.
Their is two IDE ports/ plugs on the motherboard so it would be even better if i could run more the one relay control board but one thing at a time.
Any help would be appreciated and if someone feels this is on the wrong board please let me know.
Thank you in advance.
|
|
|
|
|
Can anybody tell me how can I erase a text in a transparent window
|
|
|
|
|
|