|
Nothing mysterious is happening in MFC. You have all the sources of the library and even it isn't a peace of cake, but you always can find the reason of unexpected message box.
|
|
|
|
|
Does anyone can tell me how to active the screensaver programmatically on MS Windows platform?
|
|
|
|
|
You can use
<br />
SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,1,0,SPIF_SENDWININICHANGE);<br />
to change the screensaver timeout thus triggering it after one second. Setting the timout to zero does not seem to work, so you'll have a minimum delay of one second.
Don't forget to change the timeout back to a normal value when you're done
|
|
|
|
|
Anybody help me how to create emoticons window, just like MSN Messenger did.
Please help me in this regard
Thanks
Phantom
|
|
|
|
|
You have to create one by yourself, since there's no thing like a standard control for it. So you'll have to create your own source for it to handle everything like drawing etc.
|
|
|
|
|
Hello,
I am developing a dialog based application. It has a RichEdit Control. I derived it from RichEdit20A. Now all the properties have been closed. I apply all the properties by modifying the .RC file.
Now I do want to wrap the data, when it exceeds the RichEdit20A width. I also unselects the AutoHScroll, so that the data wraps, but it won't work any more.
Please anybody helps me in this regard
Phantom.
|
|
|
|
|
Hi,
I have a hook set up with WH_GETMESSAGE and messages are sent to my hook procedure. But I am not getting WM_NOTIFY. I have clicked on ListView items, renamed then and I still do not get the WM_NOTIFY. Is there a reason for this
|
|
|
|
|
How do you call SetWindowsHookEx, with what parameters?
Regards,
Vitaly Tomilov
Professional tooltips for all development platforms Free on www.Tooltips.NET
|
|
|
|
|
hhGlobal = SetWindowsHookEx(WH_GETMESSAGE,ProcessMessage,hMod,0);
hhGlobal is in a shared data segment and hMod is the DLL's hInstance
Ceri
|
|
|
|
|
Interesting,
But could you instead use WH_CALLWNDPROC and see how it works?
Apparently, WM_NOTIFY is posted to a message queue, or posted in a specific way.
Regards,
Vitaly Tomilov
Professional tooltips for all development platforms Free on www.Tooltips.NET
|
|
|
|
|
Hi,
I did try that but everything kept on crashing. Supose I will have to look into WH_CALLWNDPROC a little further
Ceri
|
|
|
|
|
Hello,
I'd like to make the scrollbars invisible in a HTMLView (well it is the HTMLCtrl by Paul DiLascia, but it's almost the same).
I've tried this:
this->m_cHTMLCtrl.ShowScrollBar(SB_BOTH, FALSE); but it has been unsuccessful... could you give me an advice?
Thank you in advance.
|
|
|
|
|
Hi All,
I have a Windows XP 48x48 icon with shadow, and I need to draw only part of this icon. The standard DrawIconEx function allows to draw only the whole icon. I figured there was one way of drawing parts of the icon by using function MaskBlt. However, I cannot get the proper drawing result. The best solution I’ve come up so far is the following function:
<br />
void DrawIcon(HDC dc, HICON hIcon, int x, int y, int cx, int cy)<br />
{<br />
HDC memDC = CreateCompatibleDC(dc);<br />
ICONINFO IconInfo;<br />
GetIconInfo(hIcon, &IconInfo);<br />
HGDIOBJ old = SelectObject(memDC, IconInfo.hbmColor);<br />
MaskBlt(dc, x, y, cx, cy, memDC, 0, 0, IconInfo.hbmMask, 0, 0, MAKEROP4(SRCINVERT, SRCCOPY));<br />
SelectObject(memDC, old);<br />
DeleteDC(memDC);<br />
}<br />
Body of the icon is drawn correctly, and the transparency is there too. The problem of this function is that when drawing shadows of the icon it draws just black dots instead. Experimenting with all possible combinations of parameters for macro MAKEROP4 didn’t bring any good result.
Please, help me out, anybody!!! How to draw parts of a Windows XP 48x48 icon correctly????
Regards,
Vitaly
|
|
|
|
|
Hello,
I've finished my last app. and after finding all the memory leaks, now I've noticed (using the perfmon tool) that the quantity of handlers occupied by my app is increasing each time I create a property sheet.
I would like to know:
1. is it normal?
2. how can I know where do I occupy a handler that I don't free?
3. how do I free a handler?
I thik that my questions are not enough concise, but, at least, could you point me to somewhere to find info about those topics?
Thank you in advance...
|
|
|
|
|
Joan Murt wrote:
I would like to know:
1. is it normal?
2. how can I know where do I occupy a handler that I don't free?
3. how do I free a handler?
1. NO, is not normal!
2. maybe it's a file HANDLE, an event HANDLE(check to see if you don't create a handle everytime you create a property sheet.(CreateEvent, CreateThread...))
3. look at BOOL CloseHandle(
HANDLE hObject // handle to object to close
); in MSDN. It's very self explanatory
|
|
|
|
|
I think that I'm in trouble then...
The problem arises when I use HTMLCtrl... (it's a class that allows to place a HTMLView inside a dialog).
It seems that each time that this control navigates to a web page a handle is occupied and that when I close the property sheet the handle is not being freed, but my problem is that I don't write any CreateThread, event, and neither I create a file...
I'm lost...
Could you imagine what is happening?
Thank you in advance.
|
|
|
|
|
Hello,
I know in the project settings of VC++ you can perform some actions only in 'pre-link' and 'post-build' times.
i have a *.bat file that i want it to run before the compilation starts.....
any1 knows how can i do it?
thanks in advanced
Yaron
Ask not what the application can do for you, ask what you can do for your application
|
|
|
|
|
In VC6 you open Project Settings dialog and go to the Pre-link Tab.
Pavel
Sonork 100.15206
|
|
|
|
|
Hi , thanks for your reply.
pre-line is not pre-comile, i need to call the *.bat before any sort of compilation starts.....
can u still help me?
Yaron
Ask not what the application can do for you, ask what you can do for your application
|
|
|
|
|
Yaron Nir wrote:
pre-line is not pre-comile, i need to call the *.bat before any sort of compilation starts.....
Sorry
If your bat file has an input file which changes, you can use a custom build rule.
Otherwise I'm sorry.
Pavel
Sonork 100.15206
|
|
|
|
|
You can export the makefile and launch the batch file from there. Then you might add the nmake call among the tools in order to do it quickly.
Or you can write an addin to handle this job easily
rechi
|
|
|
|
|
i need to know how to build a program or application(standalone) for show how to implementing Data Encryption Standard(DES)
pytongz
|
|
|
|
|
|
The following sample is MAPI from MSDN.
While runnin this is giving error:
Any help on this :
#include "mapix.h"
#include "mapiutil.h"
#include <mapispi.h>
HRESULT GetMAPIStatus(LPMAPISTATUS *pStatus, LPMAPISESSION pSession);
int main(int argc, char* argv[])
{
LPMAPISESSION pSession = NULL; //MAPI Session Pointer
LPMAPISTATUS pStat=NULL; //MAPI Status Pointer
LPMAPISUP pSupport=NULL;
HRESULT hRes = S_OK;
//Initialize MAPI.
hRes = MAPIInitialize(NULL);
//Log on to MAPI and get a session pointer.
hRes = MAPILogonEx(0, NULL, NULL, MAPI_LOGON_UI | MAPI_NEW_SESSION, &pSession);
if (hRes == S_OK && pSession) //if logon OK get a status pointer.
{
//Call function to get the status pointer.
hRes = GetMAPIStatus(&pStat, pSession);
if(hRes == S_OK && pStat) //if we successfully got a status pointer call FlushQueues on it.
{
//Flush inbound and outbound messages.
hRes = pStat->FlushQueues(NULL, 0, NULL, FLUSH_UPLOAD | FLUSH_DOWNLOAD);
if(hRes == S_OK)
MessageBox(NULL, "FlushQueues OK!", "FlushQueues", MB_OK);
else
MessageBox(NULL, "FlushQueues Failed!", "FlushQueues", MB_OK);
}
else
MessageBox(NULL, "GetMAPIStatus Failed!", "FlushQueues", MB_OK);
pSession->Logoff(NULL, 0L, 0);
}
else
{
MessageBox(NULL, "MAPI Logon Failed!", "FlushQueues", MB_OK);
}
//Clean up pointers.
UlRelease(pStat);
UlRelease(pSession);
MAPIUninitialize();
// MessageBox(NULL, "End of MAPI ", "FlushQueues", MB_OK);
return 0;
}
/////////////////////////////////////////////////////////////////
// Gets the spooler's status object from the session status table.
/////////////////////////////////////////////////////////////////
HRESULT GetMAPIStatus(LPMAPISTATUS *pStat, LPMAPISESSION pSession)
{
LPMAPITABLE pTbl = NULL;
LPSRowSet pRow = NULL;
HRESULT hRes;
SRestriction sres;
SPropValue spv;
ULONG ulObjType;
LPMESSAGE lpMsg = NULL;
const static SizedSPropTagArray(2,sptCols) = {2,PR_RESOURCE_TYPE,PR_ENTRYID};
if (FAILED(hRes = pSession -> GetStatusTable(0,&pTbl)))
{
MessageBox(NULL, "GetStatusTable Failed!", "GetStatusTable", MB_OK);
goto Quit;
}
sres.rt = RES_PROPERTY;
sres.res.resProperty.relop = RELOP_EQ;
sres.res.resProperty.ulPropTag = PR_RESOURCE_TYPE;
//sres.res.resProperty.ulPropTag = PR_STATUS;
sres.res.resProperty.lpProp = &spv;
spv.ulPropTag = PR_RESOURCE_TYPE;
spv.Value.l = MAPI_SPOOLER;
if(FAILED(hRes = pTbl->SetColumns((LPSPropTagArray) &sptCols,
TBL_ASYNC)))
{
MessageBox(NULL, "SetColumns Failed!", "GetStatusTable", MB_OK);
goto Quit;
}
if (FAILED(hRes = HrQueryAllRows(pTbl,
(LPSPropTagArray) &sptCols,
&sres,
NULL,
0,
&pRow)))
{
MessageBox(NULL, "HrQueryAllRows Failed!", "HrQueryAllRows", MB_OK);
goto Quit;
}
if (!pRow -> cRows || PR_ENTRYID != pRow -> aRow[0].lpProps[1].ulPropTag)
{
hRes = MAPI_E_NOT_FOUND;
MessageBox(NULL, "HrQueryAllRows Failed!", "HrQueryAllRows", MB_OK);
goto Quit;
}
/* hRes = pSession->OpenEntry(pRow -> aRow[0].lpProps[1].Value.bin.cb,
(LPENTRYID)pRow -> aRow[0].lpProps[1].Value.bin.lpb,
NULL,
MAPI_BEST_ACCESS,
&ulObjType,
(LPUNKNOWN*)&(*pStat));
*/
if (FAILED(hRes) || MAPI_STATUS != ulObjType)
{
hRes = hRes ? hRes : MAPI_E_INVALID_OBJECT;
MessageBox(NULL, "OpenEntry Failed!", "OpenEntry", MB_OK);
goto Quit;
}
Quit:
if (pTbl)
pTbl -> Release();
FreeProws(pRow);
return hRes;
}
Thank you
|
|
|
|
|
hi all,
i am making a tool bar for Internet Explorer.
I am using KBBar Sample that is provided in MSDN as well as on www.codeproject.com for downloading.
when the width of the Band containing the toolbar is made small, chevrons appear. When chevron is clicked buttons are displayed in a menu.
when these buttons(drop down buttons as well as normal push buttons) are clicked, Neither do they send any WM_COMMAND Message Nor do they send any TBN_DROPDOWN notification.
Where as in normal simple state (when band containing toolbar is of normal size), these notification and messages are observed sent and are handled easily.
i will be thankful , plz help me.
regards
Farrukh
|
|
|
|
|