|
Hi,
I need to display the available display resolution settings from monitor settigs not from display device driver.
I got the display device settings resolution by using EnumDisplaySettigs function.
Can anyone tell how to get the resolutions from Monitor?
I have tried to get Monitor Name from EnumDisplayDevices(API) and passed the same to EnumDisplaySettigns. Not Working|
awaiting your replies.
-- modified at 7:21 Friday 24th November, 2006
Balamurugan
|
|
|
|
|
Pick your article[^] of choice.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Hi,
The following code is not giving expected result for me.
I need display resolutions from the current monitor settings not from display device.
Problem is dispCurrent.DeviceName is not taken by the EnumDisplaySettings API.
Please tell me where i am going wrong.
int displayNumber=0;
DISPLAY_DEVICE dispDev, dispCurrent;
memset(&dispDev, 0, sizeof(dispDev));
memset(&dispCurrent, 0, sizeof(dispCurrent));
dispDev.cb = sizeof(DISPLAY_DEVICE);
dispCurrent.cb = sizeof(DISPLAY_DEVICE);
EnumDisplayDevices(NULL, displayNumber, &dispDev, 0);
while (EnumDisplayDevices(dispDev.DeviceName,displayNumber,&dispCurrent,0))
{
displayNumber++;
CString MonName = dispCurrent.DeviceName;
if ( (dispCurrent.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) == DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
{
// Get all modes and display them in a listbox
BOOL bRetVal;
CString sDevMode;
CString sDevModeCurr;
CString strRep = "x";
DEVMODE devmode;
DEVMODE devmodeCurr;
DWORD iMode =0;
do
{
bRetVal = EnumDisplaySettings((LPCTSTR)dispCurrent.DeviceName, iMode, &devmode);
iMode++;
if (bRetVal)
{
sDevMode.Format("%dx%d, %d bits %dhtz", devmode.dmPelsWidth,
devmode.dmPelsHeight, devmode.dmBitsPerPel,
devmode.dmDisplayFrequency);
m_sDispRes.AddString(sDevMode);
}
}
while(bRetVal);
}
}
Balamurugan from india chennai
|
|
|
|
|
Does anybody know if there is an auto build increaser in VC8? If so where and how is it configured?
In VC6 I used an add-in, but surely MS have updated a little since the dark ages.
|
|
|
|
|
Dear All,
I know sockets programming. I need to do that transfer an *.exe file one host to another host.
How do i do this ?
Thanks.
bye.
|
|
|
|
|
Hi,
Sender:
- Establish Connection
- Send info what you're going to do, eg. copy file
- Open file
- read content
- send content
- close file
- Wait for acknowledge
- Shutdown transmission
- Liu out!
Recipient:
- Establish Connection
- wait for info
- create file (from info)
- receive content
- write content to file
- close file
- acknowledge completion
- Shutdown connection
Regards
|
|
|
|
|
Also, if using Windows Sockets, you can use the TransmitFile() API to do the "read content/send
content" steps mentioned by Galatei
Mark
|
|
|
|
|
Hi
How can we retrieve the listcontrol entries are selected are not
#sanroop#
|
|
|
|
|
Hi,
GetItemState(
int nItem,
UINT nMask
);
-----------
Mila
|
|
|
|
|
Hi,
The easiest way is to use GetNextItem :
INT nItemIndex = GetNextItem(
-1,
LVNI_ALL | LVNI_SELECTED
);
Regards
|
|
|
|
|
Hi, I am making one application in VC++.NT using WIN32 APIs. Is there any way to find which edit box has a keyboard focus right now using WIN32 APIs? I need handle of the edit box when some one type in that edit box. Thanks in advance. Priyank.
|
|
|
|
|
priyank_ldce wrote: Is there any way to find which edit box has a keyboard focus right now using WIN32 APIs?
GetFocus(); to get the window that has focus, then use GetClassName or IsKindOf to find out whether the window is a CEdit .
|
|
|
|
|
thanks for your reply. But I can use GetFocus(); only if that edit control is in the same application. but I want to get handle of edit control that is in another application. Is it possible?
|
|
|
|
|
priyank_ldce wrote: only if that edit control is in the same application. but I want to get handle of edit control that is in another application. Is it possible?
GetFocus returns the window with the keyboard focus for the current thread's message queue. If GetFocus returns NULL , another thread's queue may be attached to a window that has the keyboard focus.
Use the GetForegroundWindow function to retrieve the handle to the window with which the user is currently working. You can associate your thread's message queue with the windows owned by another thread by using the AttachThreadInput function.
|
|
|
|
|
priyank_ldce wrote: I want to get handle of edit control that is in another application. Is it possible?
Your code can reside within a DLL (Global hook) in this case.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Anyone please assist on the available algorithms that can train neural networks t predict budgets.
Regards.
|
|
|
|
|
Hello, Nice to meet you.
I'd like to know how to check the state of the tray with program.
When we push the button of CD drive, its tray operates like a toggle switch.
If now it was open, then it will be closed.
And it was close, then it will be opened.
Please help me~~~
mailto:theanssi@naver.com
Studying English...
|
|
|
|
|
Hi,
IIRC it could be done with use of DeviceIoControl with IOCTL_STORAGE_CHECK_VERIFY and IOCTL_STORAGE_EJECT_MEDIA functions.
Anyway, you should find some information about it in DeviceIoControl function reference and its related articles.
Regards
|
|
|
|
|
anssi wrote: If now it was open, then it will be closed.
And it was close, then it will be opened.
Try mciSendCommand . I remember doing it sometime back, don't remember exactly how I did it.
anssi wrote: mailto:theanssi@naver.com
You are inviting spam by putting your mail ID like this.
|
|
|
|
|
Thanks for giving a reply, but I already know MCI command.
What I want is how to detect the state of which the tray is open or close whether there is a CD in the tray.
I also tried the method using MCI command, but the method was restricted because could check the state only there is a CD in the tray.
Please help me in detail as possible~~~
Studying English and Programming...
|
|
|
|
|
Hi
In MSDN:
MapUserPhysicalPages:
The MapUserPhysicalPages function maps previously allocated physical memory pages at a specified address in an Address Windowing Extensions (AWE) region
AllocateUserPhysicalPages:
The AllocateUserPhysicalPages function allocates physical memory pages to be mapped and unmapped within any Address Windowing Extensions (AWE) region of a specified process.
So sorry for this question but i really don't know what is the difference between "allocating" and "mapping" memory.
Until now i supposed that they have same meaning but i think this is not true.
Can you please tell me what do these word indicate in win32 jargon?
|
|
|
|
|
sawerr wrote: So sorry for this question but i really don't know what is the difference between "allocating" and "mapping" memory
To "map", "something" should already present. That can be done by "allocation".
|
|
|
|
|
Thanks but still i don't understand it.
Please a little more detail.
|
|
|
|
|
Does mapping mean:
Translate (from realtive to physical or physical to relative)?
Matching?
or directing?
Which one? or none of them?
|
|
|
|
|