|
ok
using Direct X how it can be done
plz help me
Ravikumar Patra
|
|
|
|
|
Asalam o Alaikum:
i want to get coloumns count from listview using SendMessage() Api function.
can anybody tell me about this.
Thanx
|
|
|
|
|
Have you missed the right forum, haven't you?
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.
|
|
|
|
|
how this is a wrong forum tell me???????
|
|
|
|
|
Because the ListView (of Windows Forms) has the Columns.Count property, i.e. there's no need to use SendMessage API function.
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.
|
|
|
|
|
you are right but what about the situation when you are retrieving data from one application to other.
we have to use SendMessage() there.
|
|
|
|
|
I have a multi threaded app, it has [STAThread] on the static void main, but all of a sudden ( and I don't see why ), it's giving me an error telling me that I should be running STA, when another thread loads files from the hard drive. I am using the backgroundworker class, and I can't work out how to make it run as STA, is this possible, or am I hosed ?
Thanks
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I don't believe that you can get the BackgroundWorkerThread to run STA, as it would go against the purpose for which it was created. What error are you getting?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
current thread must be set to single thread apartment (STA) mode before OLE calls can be made
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
There's no way that you can force the BackgroundWorker ApartmentState to STA. You're either going to have to use threading with the appropriate ApartmentState set or a version of the BackgroundWorker[^] class included here.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Cool - thank you
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No problem. Glad to help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello!
I’m working at an e-learning project for kinder gardens. The application has 2 parts: one for the teacher, in which he/she prepares lessons (the main point is that little kids learn fast, so the teacher must be ready to give them something new every time!) and one for the kids, in which they get to work with the created lessons (this part has to be very stable, as it’s mostly about drag’n’drop and little kids don’t really have boundaries in their actions!).
The teacher prepares the lesson this way: he/she chooses firstly the background image, e.g. a picture with a sky, some trees and a lake. Then he/she selects some objects, such as a bird, a sun, a fish, etc. These objects are addressed directly to the kids: they will have to match them where they belong! (with drag’n’drop). For instance, the object “sun” can only be dragged where the sky is (otherwise the drag’n’drop action doesn’t complete), the object “bird” can only be placed in the sky or in the tree (if it is placed upon the water, that is wrong).
I thought that the teacher simulates in a way the role of an administrator for the application, better said for the lessons he creates! Therefore, he/she has to be able to upload the background image, to determine its various regions (sky, lake and tree in the example above) ant then to upload the various objects he/she finds suited for the matching he/she has in mind for that particular lesson – these objects will be the ones dragged and, if correct, also dropped upon the various regions already determined, in the background image.
When starting the lesson, the kids will see the background image and next to it a panel with all the objects. They will then have to match them all correctly by drag’n’drop.
Here are my questions:
1) How can I determine the various regions of the background picture and then save them each under certain names?
2) Then, after also uploading the objects, how can I link them to specific regions (something like rules to be followed later by the kids)? (e.g.: for the sky region only the “sun” and the “bird” objects are allowed, but not the “fish”, nor the “flower” objects are!)
3) How can I save an unfinished lesson, so that the teacher will complete it later, opening it in the workspace?
Thanks a lot!
I hope my questions raised you interest and curiosity and challenged you to help me with your answers!
|
|
|
|
|
Hello all,
I've developed a monitoring service which monitors some services and starts them when they are not running.
I found a problem when the server machine is shutting down and / or restarting. Windows is shutting down some services which are monitored before my monitoring service is shut down. Result is that my monitoring service detects that the service is not running and then starts the service. Windows continues to shut down and registry corruption is the result.
I thought that detecting whether the OS (Windows Server 2003) is shutting down would be a nice solution. However this is not an easy task. The OnShutdown() method is not called in my derived class. Furthermore I don't know when this method is invoked. Is it when the shutdown is initiated before the services are stopped, or is it invoked when the OS is stopping the services?
Is there a simple way to detect whether the OS is shutting down or restarting without responding to Windows messages / events?
I'm using the .NET framework 2.0
Thanks in advance,
Bob Stanneveld
Behind every great black man...
... is the police. - Conspiracy brother
|
|
|
|
|
|
I searched the web and you can use the Microsoft.Win32.SessionEnded event, as described here.
Also, the Shutdown event in ApplicationEvents.vb or similar (I don't know about C#/++ or J#) refers to the Shutdown of your application, not the system.
|
|
|
|
|
Hello,
Thanks for the reaction! Unfortunately this is no help since my application is not receiving any messages. So the SessionEnded event will never fire for my service.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[ ^]
|
|
|
|
|
You can call the Win32 API function RegisterServiceCtrlHandlerEx[^] to register your service to receive window message-based notification, like WM_QUERYENDSESSION or WM_ENDSESSION.
But, there's a downside to doing this. Once you call RegisterServiceCtrlHandlerEx, the normal ServiceBase's control handlers, like OnStart, OnStop, ..., will no longer work. You'll have to handle the Service Control messages and do the dispatching to your handlers yourself.
Sorry, I don't have any examples handy.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
One trick is to make the services dependent on the monitoring service. Then on the service OnStart, set the shutdown priority for the monitoring service to a high priority to guarantee everything happens in the correct sequence. This can be done via:
NOTE: the SHUTDOWN_LEVEL is set at the minimum user-level available priority to set the service at the top most spot of the list.
using System.Runtime.InteropServices;
[DllImport("Kernel32.DLL")]
private static extern bool SetProcessShutdownParameters(Int32 dwLevel, Int32 dwFlags);
private const Int32 SHUTDOWN_NORETRY = 0x00000001;
private const Int32 SHUTDOWN_LEVEL = 0x281;
protected override void OnStart(string[] args)
{
if (!SetProcessShutdownParameters(SHUTDOWN_LEVEL, SHUTDOWN_NORETRY))
System.Diagnostics.Debug("Failed to set shutdown priority.");
}
However, if the service monitor is simply acting as a recovery app, then using the service recovery options may be more optimal to allow windows service manager to automatically restart the service for you.
|
|
|
|
|
Thanks for the information! I'll try this to solve the problem. I have just one question. http://msdn2.microsoft.com/en-us/library/ms686227.aspx[^] says the following about the first parameter:
[in] The shutdown priority for a process relative to other processes in the system. The system shuts down processes from high dwLevel values to low. The highest and lowest shutdown priorities are reserved for system components. This parameter must be in the following range of values.
The value 3FF is listed as the highest value for applications in the table following the description. Shouldn't SHUTDOWN_LEVEL be equal to 3FF?
Unfortunatly my monitoring service is doing more than just restarting the other services so the recovery options are not sufficient in this case.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[ ^]
|
|
|
|
|
I m making a project in c#.net,a window application.
I have a form on which i have kept a listbox, which show names of clients who are online at that particular time through a query.
Now, how can i display a small smiley image(a .jpg image) before the clients name who is online(in the listbox)?
Before each clients name in d listbox this smiley icon should appear (as in yahoo messenger)...
How can i do this?
Thank you in advance.
Regards nekshan.
|
|
|
|
|
you need to write your own control, a listbox can only display text.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
a ListBox contains an ItemCollection which holds objects; these can be user drawn,
(MeasureItem, DrawItem events) and are not limited to text...
|
|
|
|
|
Damn - for some reason, I thought he said a combo box. I must have been tired...
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
use grid control not list box for it.
|
|
|
|