|
macmac38 wrote:
Why u don't make the background transparent
Because I have used a bitmap, and not an icon. Let's use an icon
Thanks for the help.
~RaGE();
|
|
|
|
|
button->properties->styles.bitmap(click)
button->properties->extended styles.transparent(click)
i hope it will work
|
|
|
|
|
no no... i'm not right..
you can make your background transparent in the icon editor...
click the oranje/rose monitor.
sorry
|
|
|
|
|
See if this article is of any help.
http://flounder.com/bitmapbutton.htm
|
|
|
|
|
Hello,
when i like to overwrite data in a file with new data, how i do it?
I have a file where i save the filenames entered in the "save as" dialog window.
Thanks, Mark
|
|
|
|
|
Hi,
use "CFile::modeCreate" mode.
It will truncate the file to 0, if the file is already exists(overwrite). Otherwise, it will create a new file.
Hope this helps
regards
~Hari~
|
|
|
|
|
Thanks! I haven't found a good howto about CFile in the web yet. Always the same stuff like in the VC help..
regards Mark
|
|
|
|
|
I'm trying to load a bitmap into a imagelist, and to get a transparent background.
The imagelist is used in a CListCtrl.
When I load the bitmap directly I get transparent images, but wrong colors.
m_ilReport.Create(IDB_TOOLBAR_GRID256, 16, 1, RGB(255,0,255));
If I load it into a CBitmap first the colors look ok, the problem is that the mask color is replaced with black. SetBkColor seems to have no affect. I've tried with regular colors too.
m_ilReport.Create(16, 16, ILC_COLOR8, 16, 1);
CBitmap bmp;
bmp.LoadBitmap(IDB_TOOLBAR_GRID256);
m_ilReport.Add(&bmp, RGB(255, 0, 255));
m_ilReport.SetBkColor(CLR_NONE);
ctl.SetImageList(&m_ilReport);
What have I done wrong?
|
|
|
|
|
You are setting the transparency colour to be the bright pink that has
RGB(255,0,255). It's what I do in my code, as it's not a colour I use normally in the actual bitmap.
Snip of code that works for me:
m_ImageList.Create(IDB_ALARMBANNER ,16,32,RGB(255,0,255));<br />
m_nImageIndex[IMAGE_ALARMBANNER] = nImageIndex++;
<br />
AddBitmapToList(m_ImageList,IDB_ALARMCLIENT,IMAGE_ALARMCLIENT,nImageIndex++);<br />
<br />
void CMainDialog::AddBitmapToList(CImageList& ImageList, UINT nId, UINT nImageId, UINT nImageIndex)<br />
{<br />
CBitmap bm;<br />
bm.LoadBitmap(nId);<br />
ImageList.Add(&bm, RGB(255,0,255));
m_nImageIndex[nImageId] = nImageIndex;<br />
}
Debbie
|
|
|
|
|
thanks. But that doesnt help me. I want to know why it doesnt work.
Why do the colors look f***edup if I use the same overloaded version of create as you do? (The one where u specify the mask color)
Why do the mask become black when I first load the bmp into a CBitmap and then load the CBitmap into the imagelist?
|
|
|
|
|
Hallo there!
I need help... did you ever made a PS plugin??
if YES: HOW? where can i download the PhotoShop 7.0 SDK? (Not at Adobe.com)
if NO: ...
thanx for helping me;)
|
|
|
|
|
Sorry, if you want to get the official 7.0 SDK, you need to be an Adobe Solutions Network member (basic membership is US$195).
However, if you're just looking to make filter plugins, there are some more affordable options:
http://thepluginsite.com/knowhow/plugincreation.htm[^]
- Mike
|
|
|
|
|
thanx
but i realy need SDK... i know the price for it... but dont have that monny to pay
i will try to get it peer to peer...
thanx for your help anyway
|
|
|
|
|
Is there a "PreTranslateMessage" equivalent in ATL?
I need to pre-filter WM_CHAR for a dialog.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
.. about fixing a few bugs in some MFC controls, such as getting the actual selected element of a CTreeCtrl. There was also a few things about the CListCtrl in this article, which is very short but very useful. Please help me find it ...
~RaGE();
|
|
|
|
|
Hi
Anyone here at cp who works with Dbase IV database using the libraries of Codebase (www.codebase.com)? I need to add a database item to an existing db-file.
Can anyone help me out? Would appreciate it greatly!
Greetings
Jens
|
|
|
|
|
I want to send email with my SMTP server and I want to send attachments with it. For attaching file,I have to encode attached file to base64.So the question is how can I convert my data to base64?
Mazy
No sig. available now.
|
|
|
|
|
|
Thanks,I'll check it.
Mazy
No sig. available now.
|
|
|
|
|
In an MFC dialog application is there a way to trap the escape key so that when it is pressed the application won't shut down?
Thanks
|
|
|
|
|
yes, put this into your message map (.h) of that form
virtual void OnCancel();
void CMyDialog::OnCancel()
{
AfxMessageBox("escape");
}
i hope this helps.
Greetings
Jens
|
|
|
|
|
Jens,
Well after messing around with this for a little while I noticed a side effect that I had not expected. This method not only blocks the escape key but it blocks alt+F4 as well. Is there a way to know that the escape key has been pressed. I tried to capture it in OnKeyDown() but the escape key does not seem to register there. Any ideas?
Cheers,
Steve
|
|
|
|
|
You can override the OnCancel function (and not call CDialog::OnCancel() ).
|
|
|
|
|
Thanks,
That was overly easy
Steve
|
|
|
|
|
i edited a program to superclassing the editbox.
The superclassing succeeded,but when i create the superclassed editbox ,there is a problem:
i first create the superclassed editbox in the window's
wm_create message,but the editbox can not be showed out.
But it can be showed out after i move it to the winmain.
how strange it is.
Anyone can tell me why?
thanks.
<br />
#include<windows.h><br />
#include<tchar.h><br />
<br />
#define IDC_SUPERCLASS1 1<br />
<br />
static HWND hsuperedit1;<br />
<br />
WNDPROC g_editwndOrg;<br />
static LPCTSTR sz_editsuperclass=TEXT("SuperclassEdit");<br />
<br />
LRESULT WINAPI EditSuperclassWndProc(HWND hedit,UINT msg,WPARAM wParam,LPARAM lParam);<br />
<br />
LRESULT WINAPI WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)<br />
{<br />
int cx,cy;<br />
switch(msg)<br />
{<br />
case WM_CREATE:<br />
hsuperedit1=CreateWindow(sz_editsuperclass,NULL,ES_AUTOHSCROLL|ES_LEFT|ES_MULTILINE|WS_CHILD|WS_VISIBLE,100,200,300,400,hwnd,(HMENU)IDC_SUPERCLASS1,HINSTANCE)GetWindowLong(hwnd,GWL_HINSTANCE),NULL);<br />
return 0;<br />
case WM_DESTROY:<br />
PostQuitMessage(0);<br />
return 0;<br />
}<br />
return DefWindowProc(hwnd,msg,wParam,lParam);<br />
}<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR lpCmdLine,int nShowCmd)<br />
{<br />
static LPCSTR szClassName="Show Time";<br />
WNDCLASSEX wc_edit;<br />
WNDCLASSEX wc;<br />
<br />
ZeroMemory(&wc,sizeof(wc));<br />
wc.cbClsExtra =0;<br />
wc.cbSize =sizeof(WNDCLASSEX);<br />
wc.cbWndExtra =sizeof(LONG);<br />
wc.hbrBackground =(HBRUSH) GetStockObject (COLOR_BACKGROUND) ;<br />
wc.hCursor =LoadCursor (NULL, IDC_ARROW);<br />
wc.hIcon =NULL;<br />
wc.hIconSm =NULL;<br />
wc.hInstance =hInstance;<br />
wc.lpfnWndProc =WndProc;<br />
wc.lpszClassName =szClassName;<br />
wc.lpszMenuName =NULL;<br />
wc.style =CS_HREDRAW|CS_VREDRAW;<br />
<br />
ATOM atomclass=RegisterClassEx(&wc);<br />
if(atomclass==INVALID_ATOM)<br />
{<br />
MessageBox(NULL,"RegisterClass Error","RegisterClass Error",MB_OK);<br />
exit(1);<br />
}<br />
<br />
HWND hwnd=CreateWindowEx(NULL,szClassName,0,WS_OVERLAPPEDWINDOW,<br />
0,0,500,650,NULL,NULL,hInstance,NULL);<br />
<br />
ZeroMemory(&wc_edit,sizeof(wc_edit));<br />
GetClassInfoEx(NULL,"edit",&wc_edit);<br />
g_editwndOrg=wc_edit.lpfnWndProc;<br />
wc_edit.lpszClassName =sz_editsuperclass;<br />
wc_edit.hInstance =hInstance;<br />
wc_edit.lpfnWndProc =EditSuperclassWndProc;<br />
wc_edit.cbSize =sizeof(WNDCLASSEX);<br />
<br />
ATOM atomclass_edit=RegisterClassEx(&wc_edit);<br />
if(atomclass_edit==INVALID_ATOM)<br />
{<br />
MessageBox(NULL,"RegisterSuperClass Error","RegisterSuperClass Error",MB_OK);<br />
exit(1);<br />
}<br />
<br />
ShowWindow(hwnd,SW_SHOW); <br />
UpdateWindow(hwnd);<br />
<br />
<br />
MSG msg;<br />
while(GetMessage(&msg,NULL,NULL,NULL))<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
return msg.wParam ;<br />
}<br />
<br />
LRESULT WINAPI EditSuperclassWndProc(HWND hedit,UINT msg,WPARAM wParam,LPARAM lParam)<br />
{<br />
LRESULT lResult;<br />
BOOL fCallOrgProc=TRUE;<br />
switch(msg)<br />
{<br />
case WM_CHAR:<br />
if(wParam=='a')<br />
{<br />
fCallOrgProc=FALSE;<br />
}<br />
break;<br />
}<br />
if(fCallOrgProc)<br />
{<br />
lResult=CallWindowProc(g_editwndOrg,hedit,msg,wParam,lParam);<br />
}<br />
return lResult;<br />
}<br />
<br />
|
|
|
|
|