|
Mmm... I'll give a try, thank you for the advice.
|
|
|
|
|
NP. Take a look here for a good button set class. It's a bit overkill for one style though. You'll something like;
CCustomButton::OnDraw()
{
if(bHover)
draw_with_border()
else
draw_without_border()
}
Just use a TRACKMOUSEEVENT structure to determine if the cursor is hovering, and change bHover appropriately.
Simon
"The more I learn, the more I realize I don't know" - Colin Davies
Sonork ID 100.10024
|
|
|
|
|
, CButtonST is too much complex for me, I'll try to work on your idea instead, sounds quite easy to implement, thanks again.
|
|
|
|
|
|
I notice that several apps do use of that, the download manager Reget Deluxe also uses it. It's very similiar to a large toolbar vertically aligned...
|
|
|
|
|
I told you about the outlook shortcut bar expecting that there would be 20 articles on them if you did a search. Took me a while to find one or two.
From CodeGuru
From CodeProject
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I try to compile this code...
CoInitialize(NULL);
HRESULT hr;
IActiveDesktop *pActiveDesktop;
//Create an instance of the Active Desktop
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IActiveDesktop, (void**)&pActiveDesktop);
pActiveDesktop->SetWallpaper("C:\\Mina dokument\\Mina bilder\\eros15.gif", 0);
// Call the Release method
pActiveDesktop->Release();
CoUninitialize();
... but when compile:
--------------------Configuration: Wallpaper - Win32 Release--------------------
Compiling...
WallpaperDlg.cpp
c:\PROGRAM\MICROSOFT VISUAL STUDIO\MYPROJECTS\Wallpaper\WallpaperDlg.cpp(115) : error C2027: use of undefined type 'IActiveDesktop'
C:\Program\Microsoft Visual Studio\VC98\INCLUDE\COMDEF.H(507) : see declaration of 'IActiveDesktop'
c:\PROGRAM\MICROSOFT VISUAL STUDIO\MYPROJECTS\Wallpaper\WallpaperDlg.cpp(115) : error C2227: left of '->SetWallpaper' must point to class/struct/union
c:\PROGRAM\MICROSOFT VISUAL STUDIO\MYPROJECTS\Wallpaper\WallpaperDlg.cpp(118) : error C2027: use of undefined type 'IActiveDesktop'
C:\Program\Microsoft Visual Studio\VC98\INCLUDE\COMDEF.H(507) : see declaration of 'IActiveDesktop'
c:\PROGRAM\MICROSOFT VISUAL STUDIO\MYPROJECTS\Wallpaper\WallpaperDlg.cpp(118) : error C2227: left of '->Release' must point to class/struct/union
Error executing cl.exe.
Wallpaper.exe - 4 error(s), 0 warning(s)
Exactly WHAT is wrong!!!
The code is from MSDN Library so it should work....
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Did you include "Shlobj.h"?
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Well, first I did include:
#include <comdef.h>
#include <shlguid.h>
#include <shlobj.h>
because it says "undeclared identifier" to IActiveDesktop interface when only including #include <shlobj.h>.
So I did a search and looked after all files on my computer that had a string "IActiveDesktop" in, and included them... but now I get these errors which says undefined bla bla...
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
|
ok, now it works.... almost!
I want to change the background, but the cde doesn't change the background:
void CWallpaperDlg::OnButton1()
{
CoInitialize(NULL);
HRESULT hr;
IActiveDesktop *pActiveDesktop;
//Create an instance of the Active Desktop
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IActiveDesktop, (void**)&pActiveDesktop);
if(SUCCEEDED(hr))
{
pActiveDesktop->SetWallpaper((LPCWSTR)"C:\\Mina dokument\\Mina bilder\\eros15.gif", 0);
pActiveDesktop->ApplyChanges(AD_APPLY_ALL);
}
else
{
AfxMessageBox("Error o Error");
}
// Call the Release method
pActiveDesktop->Release();
CoUninitialize();
}
------------------------------------
<b><I><B>Rickard Andersson</I></B></b>, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
|
Hello,
Anybody knows how can I catch the Refresh Event using the BHO.
when the user press F5 or selects refresh from the broswer menu.
and I don't mean the DocumentComplete Event.
thanks,
|
|
|
|
|
Hi,
is it possible to change the size(thickness) of an edge drawn with a call
to the DrawEdge () function ?
I tried diferent methods, like changing the size of the border with the SystemParamterInfo
(), but it didn't work.
Maybe, selecting another pen ? How can i do that ?
Cheers,
Lion.
|
|
|
|
|
You can't. It's only used to draw simple pre-defined borders, and it doesn't use any pens. You could just use CDC::Rectangle() with a thick pen and a null brush.
Simon
"The more I learn, the more I realize I don't know" - Colin Davies
Sonork ID 100.10024
|
|
|
|
|
Anyone care to tell me what messages I should handle in the dialog when someone is sizing with the gripper on a status bar...???
Merci buckets!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I'm cloning notepad for windows, and i'm having trouble figuring out the Select all command. is there a message i can just send for that, and what is it, or is more complex code necessary?
|
|
|
|
|
::SendMessage(hWndEdit, EM_SETSEL, 0, -1);
The 0 is the start position, and the -1 is the end position. Because it is -1, this tells the window to select all of the text in the edit control.
|
|
|
|
|
If you are using MFC CEdit then check
CEdit::SetSel member function
Atul
Sonork 100.13714 netdiva
|
|
|
|
|
I'm looking for C++ code that compress Null-terminated string to minimum bytes.
The string has between 1 and 50 characters.
Thanks in advance
Didi
|
|
|
|
|
If it's only for 1 to 50 characters why compress...?
Anyways...each character uses 1 byte...but normal english requires only decimal 33 to 126 ascii.
126 - 33 = 93...which is not even close to 255, the maximum value that can fit into one byte.
11111111=255
01111111=127
00111111=63, no good!
from the above you can see that by using only the ascii characters in this range you can knock off one bit on each character, 8 characters later...thats one byte saved.
If you don't need case and some of the funny characters you could further shave off another bit, saving even more memory.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Thanx HockeyDude,
I forgot to say that the string has uppercase letters only and no special characters except underscore. (f.e MY_NAME_IS_DD)
do you have any idea when I can find C++ code that imlements what you described ?
Thanx
DD
|
|
|
|
|
I don't actually, but it sounds like a interesting project to undertake when time permits.
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
What is wrong with this?
CPaintDC dc(this);
Graphics graphics(dc.m_hDC);
Bitmap* bitmap;
bitmap = Bitmap::FromResource(AfxGetApp()->m_hInstance, L"IDB_BITMAP1");
CachedBitmap cachedBitmap(bitmap, &graphics);
graphics.DrawCachedBitmap(&cachedBitmap, 10, 10);
I get nothing painted at all? I get no errors from the compiler at all either.
|
|
|
|
|
bitmap = Bitmap::FromResource(AfxGetApp()->m_hInstance, MAKEINTRESOURCEW(IDB_BITMAP1));
|
|
|
|