|
I have an application which works with multiple monitors. I follow the process shown below (C not MFC, but the idea is the same.)
Start by setting up the monitors in Windows so they display diferent information.
Use EnumDisplayMonitors(NULL, NULL, MonitorInfoProc, 0) - the MonitorInfoProc callback procedure is called once for each monitor, and receives a handle to each monitor.
Using that handle (within MonitorInfoProc ), you can get the parameters for each monitor, by using GetMonitorInfo(hMon1, &monitorInfo) , and then access the various parameters such as lMonitorTop[uMonitorBeingEnumerated] = monitorInfo.rcMonitor.top and lMonitorLeft[uMonitorBeingEnumerated] = monitorInfo.rcMonitor.left .
Look at the members of the MONITORINFO structure to see what information is available.
Once you have the top left of each monitor and the size of each monitor, use SetWindowPos to position your windows where you want them.
|
|
|
|
|
I have keypad as a input. It use usb to connect. There is a driver to drive it. Is there anybody can give me an idea to use joystick as a mouse and keypay button(only number) to chose the button on the windows.
Thanks in advance
|
|
|
|
|
you can use DirectX input library.
DirectX input supports APIs related human interface device(HID) like joystick, light pen and etc.
you don't need to init the video mode even if you're using DirectX.
DirectX is just library.
And there are so many sources on the internet about DX input.
Good luck.
Anderson Sheen (exteide@gmail.com)
The Extension IDE: http://www.exteide.com
|
|
|
|
|
Hi .
Does anyone have a working code to change a file attributes from FILE_ATTRIBUTE_DIRECTORY to FILE_ATTRIBUTE_NORMAL.
Simply speaking I need to make a file from the directory.
student
|
|
|
|
|
You could try SetFileAttributes() but I doubt it will work. Stranger things have happened, though.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I don't know what you are trying to achieve, but I doubt whether changing the attribute will do it! A file which is actually a set of directory entries (if that is what this would give) would not be useable in other applications (i.e. if you opened it with notepad or word, I don't think it would give anything recognisable as a directory listing, in case this is what you are trying to achieve.)
Maybe this would be a way to hide your directory full of smut, but if someone else runs scandisk, the clusters occupied by the files would be freed, since they are apparently unused (I guess that's what might happen - I've forgotten about directory structures, etc.)
Try the other suggestion regarding setting attributes, but if that does not do what you want, I suggest that you try to describe what you are trying to achieve in a few sentences - maybe someone can give ideas then.
|
|
|
|
|
Hi , thank you for the message. I know very good a sequences of the attribute changes…
The SetFileAttributes will not allow to change directory to file. I need some FAT32 or NTFS direct functionality , probably at the low level file access. Like it was with Norton Editor for DOS. NE for DOS allowed to change attributes from directory to file, and you are right, everything under that directory disappeared for the DOS. In my case it is a fast way to remove full path.
student
|
|
|
|
|
Ah, OK.
Thanks for the explanation of what you are trying to do.
Sorry - I can not offer any suggestions.
|
|
|
|
|
I want to write an application that overlays information on the window(s) of another external application. Basicly I want to draw information on that applications window. Does anybody have a clue on how to do this?
I can think of two strategies:
1. Write the information on a transparent window an make sure that the windows stays over the application I want to modify through constantly monitoring the window hierarchy.
2. Make som kind of hook in the external program and capture paint events. After the original paint is done I have some own code that writes what I want over the GUI.
I think I would prefer the first strategy if it is possible, since it is less intrusive and eaisier to adopt to different kinds of applications. But I don't know if it is possible to do a window that is completly transparent to mouse and keyboard events. I wouldn't want my application to steal the focus from the application I modify. The modification should be visual only. Another problem is that I guess it might be hard to make the Z order and positioning to be in perfect sync all the time (although short missalignments is acceptable).
Does anyone have an clue of which API calls to use to make such a system? Does anyone have any sample code that does similar things?
|
|
|
|
|
You can use CImageList.
CImageList.BeginDrag
CImageList.DragMove
CImageList.EndDrag
Above will satisfy your request.
It supports transparent drawing. but you would need some trick.
Anderson Sheen (exteide@gmail.com)
The Extension IDE: http://www.exteide.com
|
|
|
|
|
If you give the window the WS_EX_TRANSPARENT extended style, it will pass through mouse clicks to the window beneath it. As for the Z-order issue, I'm not sure what would be the best way to solve it. It may be easier simply to hook the window and subclass it, and redo the painting.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
I don't think so, message are #define , so they will be replaced at compilation.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: I don't think so, message are #define, so they will be replaced at compilation.
Ok, thanks. My next question will be, why not? It is not like Microsoft is going to change the values from version to version.
My articles and software tools
|
|
|
|
|
Why keep a string in an application if only the numerical ID is important ? imagine if in any application you would keep a string equivalent of each ID ( resources, and messages ) ... the application would grow for nothing.
and it's much more efficient to compare integer values than strings.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I am playing with global/local hooks. Now I intercepted all those messages in my hook procedure, I want to print the messages to a log file (I want readable names instead of numeric values so that I can figure out what I can do with the hooks).
According to what you said, there is no API that can give me the message names except writing a giant "switch" block myself, right?
My articles and software tools
|
|
|
|
|
Xiangyang Liu wrote: I want to print the messages to a log file (I want readable names instead of numeric values so that I can figure out what I can do with the hooks).
Just create a map within your application. See MFC's CMap class for starters. STL probably has a similar collection. You could try FormatMessage() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
In the VC watch window, enter "116,wm" and it'll show the text version if it is available.
--Mike--
|
|
|
|
|
|
Thanks. What I am looking for is a way to get the text of a windows message from my code so that I can print readable information into a log file.
My articles and software tools
|
|
|
|
|
I'm not aware of any API. A good amount of the messages change meaning
depending on the window class of the recipient. The nearest to a cunning idea I have is to parse windows.h...
Tedious, admittedly.
Iain.
|
|
|
|
|
I used VC++6 a few years ago and then was out of programming for a long while. Trying to get back to it again (C++) using VS .Net 2003. Got a book (Step by step) where the author shows:
Console.Write(S"....");
What does the 'S' do? I've seen it with and without it and it seems to work the same either way. Where can I read about? I've tried looking in the .net help but I guess I'm not using the right search.
Thanks,
Jose
|
|
|
|
|
The S prefix on a string literal means "this is a managed Unicode string".
--Mike--
|
|
|
|
|
I get the string in each iteration of loop and i have to append that string at the end of file, but i am not getting the all values , file only shows(have) last written value in it.
I am using the code below:
CString text; //assume text var have different value in each iteration
For ( int i = 0 ; i <=5; i++)
{
CString filename = "f:/ TestFile.pc" ;
CFile files;
files.Open( filename , File::modeCreate|CFile::modeReadWrite|CFile::typeBinary);
files.Seek(0L,CFile::end);
files.Write(text , text.GetLength ());
//
files.Close ();
}
Regards.
|
|
|
|
|