|
Have you set the ACS_TRANSPARENT style when you created the control? That should be all you have to do.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hello
How can one make a tooltip alpha blended? I've grabbed the code from MSDN, and added a WS_EX_LAYERED style to the tooltip and call to SetLayeredWindowAttributes(), which seems to be enough. But it does not work. Here's code:
void CreateMyTooltip (HWND hwnd)
{
// struct specifying control classes to register
INITCOMMONCONTROLSEX iccex;
HWND hwndTT; // handle to the ToolTip control
// struct specifying info about tool in ToolTip control
LPTOOLINFO ti;
unsigned int uid = 0; // for ti initialization
char strTT[30] = "This is your ToolTip string.";
LPTSTR lptstr = strTT;
RECT rect; // for client area coordinates
/* INITIALIZE COMMON CONTROLS */
iccex.dwICC = ICC_BAR_CLASSES;
iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCommonControlsEx(&iccex);
/* CREATE A TOOLTIP WINDOW */
hwndTT = CreateWindowEx(WS_EX_TOPMOST,
TOOLTIPS_CLASS,
NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | WS_EX_LAYERED| WS_EX_TOOLWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
300,
200,
hwnd,
NULL,
NULL,
NULL
);
SetLayeredWindowAttributes(hwndTT, 0, (255 * 70)/100, LWA_ALPHA);
gOldTooltipWndProc = (FARPROC)SetWindowLong(hwndTT,
GWL_WNDPROC,
(DWORD)TooltipWndProc);
/*SetWindowPos(hwndTT,
HWND_TOPMOST,
0,
0,
0,
0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);*/
/* GET COORDINATES OF THE MAIN CLIENT AREA */
GetClientRect (hwnd, &rect);
/* INITIALIZE MEMBERS OF THE TOOLINFO STRUCTURE */
ti = new TOOLINFO;
ti->cbSize = sizeof(TOOLINFO);
ti->uFlags = TTF_ABSOLUTE | TTF_TRACK;
ti->hwnd = hwnd;
ti->hinst = NULL;
ti->uId = uid;
ti->lpszText = LPSTR_TEXTCALLBACK;//lptstr;
// ToolTip control will cover the whole window
ti->rect.left = 0;
ti->rect.top = 0;
ti->rect.right = 0;
ti->rect.bottom = 0;
/* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */
SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) ti);
SendMessage(hwndTT, TTM_TRACKACTIVATE, (WPARAM)TRUE, (LPARAM)(LPTOOLINFO)ti);
gHwnd = hwndTT;
gpTi = ti;
}
What am i doing wrong? Thanks for help
|
|
|
|
|
Hi All,
I am in a bottleneck and need your help to come out of it. I have a Shell DLL which will load from a USB CDROM media. When the shell is loaded and my computer is open the tray Icon on the system tray is not allowing me to stop the device. To overcome this I have to logoff logon each time. I tried the normal ways of Unloading the shell DLL (By using DllCanUnloadNow()) still no use.
Thanks for your help in advance,
Raja.
|
|
|
|
|
i am a final year student from uitm.right now i am doing my final year project. i got a problem on how to develop a chat appliCation by using c++ language. my thesis title is ipv6 multicast chat application. i have to create a chat application for this. it doesn't matter whether it is a simple one.but i do not have enough skills in programming language. i have try to do it but not success. so i really really hope that if someone here who are really capable of doing chat application using c++ programming to help me.
so someone please HELP me.
-- modified at 7:48 Thursday 24th November, 2005
|
|
|
|
|
Hello,
I'm trying to modify a black&white bmp file by replacing certain areas with the data obtained from other bitmaps. I have no problem in doing this with the gdi+ functions. My problems have arrived when I have tried to insert strings in some places in the bmp file. I just don´t know how to do it. Can anybody give me the clue?
Any help will be really appreciated,
Itziar
|
|
|
|
|
If you are using GDI+, use
DrawString( ) with SetTextRenderingHint() and SetInterpolationMode.
Cheers
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Thank you for your help. I´ll have a look at these functions, but one more question, aren´t they used to display images? You see, I want the text to be saved into the bmp file. I´m not displaying images.
Itziar
|
|
|
|
|
You can take the Graphics object of a bitmap and draw directly to it. You can then save the Bitmap using the Save method.
Cheers
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Thanks. It's worked fine for colored bmps.
Itziar
|
|
|
|
|
Hi !
I want to check if a specific folder exists. I looked in the MSDN but could not find anything...
Any idea ?
Thanks
|
|
|
|
|
Hello.
You can use stat() / _stat()
Or _access()
Kakan
|
|
|
|
|
Thanks
|
|
|
|
|
Try PathIsDirectory( ) or PathFileExists( )
Cheers
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi,
CreateDirectory will return ERROR_ALREADY_EXISTS if the specific directory already exists.
Bye
Cool Ju
Dream Ur Destiny
|
|
|
|
|
if( (DWORD)-1 == GetFileAttributes(szDirectory) ){
// does not exist
} else {
// file or directory exists
}
|
|
|
|
|
Hi,
I am creating a shell namespace extension to show FTP files. I implemented cut / copy and paste using CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR. I implemented IDataObject and IStream for this. After copying, when I choose to paste the files, I am getting all the files, But the problem is that, the directory structure is not retained.
If I am copying a folder say "Test", which contains 2 files
1. a.txt
2. b.txt
When I choose paste, I am getting 2 files ( a.txt and b.txt ) and a folder ( Test ) in the same place. In fact it should have been folder "Test" and the two files inside "Test". But that is not happening.
I believe I am missing something here...
Could somebody please help me in resolving this.
Thanks and Kind Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I have made an ActiveX control (.OCX) for web interface.
It has some member variables. And I had not implemented Get/Set methods for
those variables.
Throught the web page, I can set the values of above variables by <param> tag.
But now, I want to set the values of above variables by container application.
I made MFC application project by VC++. Above ActiveX control is inserted.
But, I cannot find the way to set the values of ActiveX's variables by the
same way as the <param> tag.
I think there is the way to set value to these variables because the Internet
Explorer can set without Get/Set methods.
How can I set the values of ActiveX's variables?
Please understand my poor English. English is not my mother tongue.
Following codes are some piece of my ActiveX control.
//################## SampleCtrl.cpp #########################
.........
void CSampleCtrl::DoPropExchange(CPropExchange* pPX)
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
// TODO: Call PX_ functions for each persistent custom property.
PX_String(pPX,_T("sUserID"), strUserID );
PX_String(pPX,_T("sVerifyCode"), strVerifyCode );
PX_Short(pPX,_T("nLevel"), nLevel );
}
........
// ############## SampleCtrl.h #####################
class CSampleCtrl : public COleControl
{
....
private:
short int nLevel;
CString strVerifyCode;
CString strUserID;
};
// ############## test.html ####################
<OBJECT ID="Sample" WIDTH=340 HEIGHT=150 CLASSID="CLSID:D870D8B9-16CC-4445-9BE3-36BDFF5621E6">
<PARAM NAME="sUserID" VALUE="superman">
<PARAM NAME="sVerifyCode" VALUE="K4HVD-Q9TJ9-6CRX9-RQ2D3">
<PARAM NAME="nLevel" VALUE="3">
</OBJECT>
-- modified at 6:22 Thursday 24th November, 2005
|
|
|
|
|
If its your ActiveX control, then expose the variables using Properties. Create a new property for each of the variable and the IDE will generate the Getter and Setter.
From your HTML / Javscript code, you can directly access the variable using the property name as they are using IDispatch. From your VC++ code, you can use Getter and Setter methods.
Cheers
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Thank you for your reply.
Yes, the ActiveX control is made by me.
But, I don't want to modify the ActiveX control at all.
Just I want to know how can access it's variables as the Internet Explorer.
If I will modify my ActiveX control, I can solve this problem.
But I cannot find the way to access to such variable without Get/Set methods.
Is there another way to access?
|
|
|
|
|
Hi,
I want to resize a control in list subitem as I increase or decrease
column width.I am handling this in OnCustomDraw() but it is flickering.I want to set SetRedraw() to TRUE and FALSE but in which event should I do that?
|
|
|
|
|
If the flickering occurs when you are resizing, then try calling SetRedraw() in your OnSize() handler.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi everyone!
Revising some code I've found this:
for(int i=0; i<m_aArray.GetSize(); i++)<br />
{<br />
...<br />
if(bCondition)<br />
break;<br />
}<br />
<br />
if( i==m_aArray.GetSize())<br />
{<br />
...<br />
}
That caused an ASSERT(HowCanItBe) into my brain. If "i" is declared into the
"for", how is possible to use it later? The code compile right, so Was I
wrong thinking that "i" _is_declared_ into the "for"?
Then, talking with the partners at work someone pointed out that in VS you
can do it, but in C++Builder it wouldn't compile.
The question is
What is the standard? And how are declared that kinds of variables?
And just testing I can do things like
for(int i=0; i<5; i++)<br />
{<br />
...<br />
}<br />
i = 6;<br />
for(int i=7; i<8; i++)<br />
{<br />
...<br />
}
what is the scope then?
Thank you in advance.
Regards.
|
|
|
|
|
I think the actual rule is that:
for (int i = 0; i < 10; i++)<br />
{<br />
}
//now i is invisible here.
But in VC6 it is visible after the for (...)
And I believe in VS .net compiler, they have complied with the standard and local variables are not visible outside anymore.
this is this.
|
|
|
|
|
Gizzo wrote: If "i" is declared into the
"for", how is possible to use it later?
In VS 2005 it's back to normal "i" won't be visible outside for
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|