|
|
no. if u have the solution tell me
|
|
|
|
|
The MSDN says
The SetThreadDesktop function will fail if the calling thread has any windows or hooks on its current desktop (unless the hDesktop parameter is a handle to the current desktop).
did u checked that ?
nave
|
|
|
|
|
Instead of using this handle i used Current window handle ie
CMyDlg dlg(AfxGetMainWnd());
or
CMyDlg dlg(this);
dlg.DoModal();
Same assertion occurs
bRes = SetThreadDesktop(hDesk);
hWnd = GetDesktopWindow();
CWnd *MyWindow;
MyWindow = CWnd::FromHandle(hWnd);
CMyDlg dlg(MyWindow);
dlg.DoModal();
|
|
|
|
|
No.. thats not the problem...
For u to display a dialog in another desktop...First create a new thread. Then write the above the code in that thread function...
bRes = SetThreadDesktop(hDesk); <br />
hWnd = GetDesktopWindow(); <br />
<br />
CMyDlg dlg; <br />
dlg.DoModal();
plz check if this is working..Also let me know the result
nave
|
|
|
|
|
|
How to get scrool bar of List Control? And make list scroll to some pos.
|
|
|
|
|
use the CListCtrl member function "Scroll"
Scrolls the content of a list view control.
BOOL Scroll(
CSize size
);
Parameters
size
A CSize object specifying the amount of horizontal and vertical scrolling, in pixels. The y member of size is divided by the height, in pixels, of the list view control's line, and the control is scrolled by the resulting number of lines.
Return Value
Nonzero if successful; otherwise zero.
also take a look at GetScrollPos to get the scroll position
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
We have developed one project in which we have to sort out the fields based on filter condition. The project should be similiar to the one we have in the excel sheet. The first Row in data grid control will be static and we cannot edit anything in that. It actually has the column names from the database. But the filter condition has to be placed there. A dropdown box should appear when we click that column name and the unique values residing under that column has to be displayed. The rows in the grid has to be refreshed according to the filter condition we applied.
please let me know the ways in which it can be implemented. please give me the source code if possible.
|
|
|
|
|
by using RegNotifyChangeKeyValue() ,we can notify the changes,then how i can capture the changed key name ,value,status i used RegQueryValueEx(),
i got some garbage value like iiiiiiiiiiiiiiiiii.
Any one give idea about how to capture the name after identifying the notification.
Thanks
Kiran.V
|
|
|
|
|
show the code you are using to capture the change of a key name, and we will see why you get a garbage....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi Yaron,
I want to monitor the changes in the registry,By selecting on of the Root key then monitor the changes in that inlcude key,subkeys.....for name,value and status.
i Add the code in the thread function for monitoring as belowvoid
MonitorThread(void* pParam)<br />
{<br />
DWORD dwFilter = REG_NOTIFY_CHANGE_LAST_SET, dwType, dwSize ;<br />
char lpszUser[81];<br />
HANDLE hEvent;<br />
HKEY hKey;<br />
LONG lErrorCode;<br />
<br />
while(1) {<br />
m_Sec.Lock();<br />
dwSize = 81;<br />
dwType = REG_SZ;<br />
<br />
lErrorCode = RegOpenKeyEx(hKey, NULL, 0,<br />
KEY_NOTIFY | KEY_READ, &hKey);<br />
<br />
hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);<br />
<br />
lErrorCode = RegNotifyChangeKeyValue(hKey, TRUE, dwFilter, hEvent,TRUE);<br />
<br />
WaitForSingleObject(hEvent, INFINITE);<br />
<br />
lErrorCode = RegQueryValueEx(hKey,NULL,0,&dwType,(unsigned char*)lpszUser,&dwSize);<br />
<br />
int item=pList->InsertItem(pList->GetItemCount(),lpszUser);<br />
lErrorCode = RegCloseKey(hKey);<br />
<br />
m_Sec.Lock();<br />
CloseHandle(hEvent);<br />
}<br />
<br />
<br />
<br />
}
For reading root key i put one combo box in the dialog and selecting one root key by pressing start button starts the monitoring ,if any changes occurs in the that rootkey registry display that key name,value ans status(create/modify/delete).
by pressing stop button stops the monitoring
Thanks,
Kiran.V
|
|
|
|
|
I want to defrag and optimize RAM.so that the unreleased memory
will be released.can anyone help me to write the program.
Thanks
nirmal
|
|
|
|
|
I am not sure what you mean by that but if you are talking about physical memory management then look into Address Windowing Extensions provided in Win API. It lets you lock in some pages in physical memory, for example, when you do OS-level optimization of your algorithms working with reasonably large data sets.
|
|
|
|
|
How to improve the resolution of a bitmap in a .bmp file. When I print the bitmap, its resolution is not good.
Can anyone suggest me some code to improve its resolution???
aasstt
|
|
|
|
|
The only reason i can think of that your bitmap resolution is not good, is because you strech it even not intently.
make sure when you blit the bitmap, that the cx and cy are correct (meaning you got them right using the GetBitmapDimentions method)....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I have created a compatible DC of the printer DC and then I have Converted DDB to DIB. Then I have written this DIB in a .bmp file. but when I open this file in Paint & give its print its resolution is not good.
aasstt
|
|
|
|
|
Can you be more specific.
|
|
|
|
|
I have created a compatible DC(MemDC) of the printer DC.
Then MemDC->SelectObject(bitmap)
Then whatever I draw on the screen is drawn in memory.
and then I have Converted this bitmap from DDB to DIB.
Then I have written this DIB in a .bmp file. but when I open this file in Paint & give its print its resolution is not good i.e it is not appearing as a smooth image but an image with steps in it.
aasstt
|
|
|
|
|
aasstt,
I dont know your code but I use handle printer dc and I created bitmap
or I load bitmap from file and then print and resolution isnt bad.
Now you have bitmap from file or you created bitmap inside your program
|
|
|
|
|
I have created the bitmap and then written that bitmap using the WriteDIB function(which I have downloaded from codeproject)in a .bmp file.
aasstt
|
|
|
|
|
if you have bitmap(that you created) why you directly print instead save to file and again loaded?if it has handle HBITMAP
|
|
|
|
|
How to output a two dimensional array of datatype int array[x][y]in a Listbox control?
|
|
|
|
|
may i know what u r trying to do actually?
how u need the output???
Regards,
Prashanth.v
|
|
|
|
|
I would like to access each and every element in this array[100][100], in either list box or Edit box...but i couldnt get any result, my programm is gettign hanged,, plz help me
For eg:
int array[100][100];
CListbox m_intoutput;CEdit m_intoutput;
for(int i=0;i<100;i++)
for(int j=0;j<100;j++)
{
m_intoutput=array[100][100];
}
|
|
|
|