|
I don't know how to create a handle to my icon.
I hope I made it clear that I want to create the icon in the "taskbar statusbar". Just left of the clock that is. In MSDN I found something called Shell_NotifyIcon is this perhaps what I should use ?
Thanks for helping me out !
/John
|
|
|
|
|
I don't know how to create a handle to my icon
LoadIcon
I hope I made it clear that I want to create the icon in the "taskbar statusbar"
Quite the opposite - you asked for icon in statusbar. Statusbar != taskbar. There's no such thing as "taskbar statusbar" (however, it would be pretty good name for pub visited by developers)
In MSDN I found something called Shell_NotifyIcon is this perhaps what I should use
Yes.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Seems like I got it wrong, what I ment was Taskbar Status Area.
I have gotten so far that I can create default icons (100-105), but still not the ones that I create. I assume that I don't use LoadIcon correctly.
|
|
|
|
|
I can create default icons (100-105)
What do you mean by 'default icons' (100-105)? The predefined icons (the ones with IDI_ prefix) have numeric identifiers well above 32000.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
If I call MAKEINTRESOURCE(101), i get a yellow warining triangle. Numbers 100-105 shows Icons, the others that I have tryed are empty.
My own Icon is defined in the resource.h
#define IDI_ICON1 101
In the .rc file the icon is defined like this:
IDI_ICON1 ICON DISCARDABLE "MyIcon.ico"
But if I make the call
LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_ICON1) )
an empty space will show.
I have tryed to change the define to some other number and call that number with MAKEINTRESOURCE. That also creates empty space.
The cpp file:
/*--------------------------------------------------*/
#include <stdio.h>
#include <windows.h>
//#include <commctrl.h>
#include <shellapi.h>
#include <winuser.h>
#include "resource.h"
//#import "Comctl32.dll"
//#define IDI_ICON1 1
#define WM_TRAYMESSAGE WM_USER
HINSTANCE g_hInstance;
static VOID ShowNotifyIcon(HWND hWnd,BOOL bAdd)
{
NOTIFYICONDATA nid;
ZeroMemory(&nid,sizeof(nid));
nid.cbSize=sizeof(NOTIFYICONDATA);
nid.hWnd= NULL;
nid.uID=0;
nid.uFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage=NULL;
nid.hIcon =LoadIcon(g_hInstance, MAKEINTRESOURCE(101) );
lstrcpy(nid.szTip,TEXT("Dryer is active"));
if(bAdd)
Shell_NotifyIcon(NIM_ADD,&nid);
else
Shell_NotifyIcon(NIM_DELETE,&nid);
}
void main(void)
{
ShowNotifyIcon(NULL,1);
Sleep(3000);
ShowNotifyIcon(NULL,0);
}
/*----------------------------------------------------------*/
resource.h:
/*----------------------------------------------------------*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Icon1.rc
//
#define IDI_ICON1 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
/*----------------------------------------------------*/
The project is a console application in VC++ 6
|
|
|
|
|
I am new to programming and was wondering how to successfully add a class to a Dialog based project. I am using VC++ 6.0. I am trying to add the CxShadeButton class, that is posted on this site, in to my project. I tried
the 4 steps listed in the source code but keep receiving "Program termination error message". When I exit C++, I then get the blue screen. Any input would be appreciated. I did download the demo and it worked great.
Thank you.
Annette
mailto:mannette@gte.net
|
|
|
|
|
I have a modeless property sheet class derived from CPropertySheet to provide a dialog box with a tabbed control on it. I want to add some controls above the tabbed part.
Where do I need to handle this (OnCreate , OnInitDialog , etc.)? And how do I implement it? I have tried using GetWindowRect for AFX_IDC_TAB_CONTROL (or whatever the ID is) and then using MoveWindow but it always seems to put the origin at the top left of the dialog.
Thanks,
Derek.
|
|
|
|
|
Check these KB articles: Q143291,Q140585, Q140586 and "Adding Controls to a Property Sheet" in VC++ help
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I would like to know if i could use _cpp_max to compare 2 double. If not, could i find a method which do that, or must i implement it?
thanks in advance
gerald
|
|
|
|
|
Hi all,
My recordset is open:
m_rs->Open(dbOpenDynaset, "SELECT * FROM PERSON");
.
.
.
Now, i need query on the Person table, so i have two way:
Way 1: Using of m_strFilter:
m_rs->m_strFilter = "[NAME] = 'Ali'";
m_rs->Requery();
Way 2: Using closing and then opening again:
m_rs->Close();
m_rs->Open(dbOpenDynaset, "SELECT * FROM PERSON WHERE [NAME] = 'Ali'", dbForwardOnly | dbReadOnly);
What is your idea ? which is faster for my query ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
As with most things in our world... it depends!
The general rule should be to always do a requery to cut the overhead of destruction and construction of your recordset... Remember that this happens TWO places... in your app and on the database engine. So you generally want to modify the filter and requery...
EXCEPTION:
There are times, on certain DB engines when using a Filter sets up a read only recordSet.... regardless of the MFC Documentation. In cases where you require edit or add using the filter can produce 'Recordset is not updateable' or a message to that effect!
|
|
|
|
|
Hey Guys
This may seem like a stupid question but im really stuck. Could anyone tell me what include file i need in order to do File I/O using the windows MFC.
Thanks
Peter
|
|
|
|
|
For ansii c++ file i/o, include <io.h>
For mfc file i/o (using the CFile class), you're good to go by including your stdafx.h file.
|
|
|
|
|
Does somebody know how to install an active X component
in the Microsoft Visual C++ 6.0 Install shield?
Thanks,
John
|
|
|
|
|
If you mean the InstallShield version that comes with Visual Studio 6, then you need to create a new "File Group" for self-registering files (COM objects, ActiveX Controls). After creating the file group, select it in the File Groups tab, and the right hand pane should show some settings for this file group. Double click the "Self-Registered" setting, and you can select the Yes option. This will attempt to register all of the files in this group once they've been copied.
Hope this helps - let me know if you need more info.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hi,
I've been looking around for some introduction on how to use the Tab control in VC++ 6. And yes I know, in many situations it is probably better to use a Property Sheet instead (blah blah), but the thing is that I don't want to use a dedicated dialog for the tab control, and don't want to mess with apply, ok and cancel buttons, I jut want to add a small tabbed area on an already existing dialog (where things have gone a bit messy).
Now, I don't really have a problem with creating the control, assigning a control object to it, to add tabs and (hopefully) to get the message interpreter working. But what I'm not really up to is how to make borderless child dialogs (created with the resource editor) pop up when I change a tab.
Is there (somewhat detailed) info about this on the web, or could someone explain to me (slowly, please) how to do this?
Thanks,
/Daniel
|
|
|
|
|
Check the KB article Q161886. It's titled "Property Sheet as the View Window of a CFrameWnd", but there's no 'real' property sheet in this sample - they create CTabCtrl and host child dialogs inside.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi All,
I have a problem with DCOM Configuration.I am running a DCOM
Server in a REmote Machine(Windows NT).The client in another
M/C(Windows NT ) tries to communicate with the server.The CCI
for the server component succeeds .But,I am unable to call any
function of the Server Component.I am getting "Access is Denied"
problem . I have tried iwth Default & Custom access
permissions.Still, the problem is there.
The same server component worked well once in a system with OS
Windows 2000.
What could be the problem.I am using same CoInitializeSecurity in
both Server & Client.
All security attributes I set as NULL.Where am I going wrong ?
At the same time the problem is resolved if I use no password(Domain - Administrator) on both Server and Client.
But, this should not be case.Though the Server and Client are using different passwords the DCOM should work.What should be done?
Thanx in advance for the help.
Regards,
yamini.
|
|
|
|
|
Hi All,
I have a problem with DCOM Configuration.I am running a DCOM
Server in a REmote Machine(Windows NT).The client in another
M/C(Windows NT ) tries to communicate with the server.The CCI
for the server component succeeds .But,I am unable to call any
function of the Server Component.I am getting "Access is Denied"
problem . I have tried iwth Default & Custom access
permissions.Still, the problem is there.
The same server component worked well once in a system with OS
Windows 2000.
What could be the problem.I am using same CoInitializeSecurity in
both Server & Client.
All security attributes I set as NULL.Where am I going wrong ?
At the same time the problem is resolved if I use no password(Domain - Administrator) on both Server and Client.
But, this should not be case.Though the Server and Client are using different passwords the DCOM should work.What should be done?
Thanx in advance for the help.
Regards,
yamini.
|
|
|
|
|
Thanks to everybody who answer my appeal on 25 July. I have downloaded the files. I have written some code, however my problem is I always get a linker error message for the openBrowser function, even if I have included where to find the .lib and .dll file in my compiler settings. The same occurs with the C version of the function. Anybody else have the same problem or know of a solution?
|
|
|
|
|
Hi
I have implemented tool tips using the CToolTipCtrl, does anyone know if this can be used to display the ballon style tool tips. Or any other way my code could be easily converted.
Cheers
Rich;P
|
|
|
|
|
first: you must use IE 5 or later
create the control using the TTS_BALLOON style:
m_tooltip.Create (this,TTS_NOPREFIX|TTS_BALLOON);
for the TTS_BALLOON define you should use the CommCtrl.h from the Platform SDK or simply define it yourself:
#define TTS_BALLOON 0x40
|
|
|
|
|
Hello,
I have an application with several ToolBars. Every time I start it my toolbars are arranged one under another and take much space on the screen. So, I would like to save and restore their positions on the screen.
When I try to remember top-left corner information in the registry, the restoration does not have a good effect as the toolbars need to be distant from each other.
Please, tell me the way to restore exactly the same set of toolbars.
Thanks in advance,
Andrei
|
|
|
|
|
if you are using MFC, you can use CFrameWnd::SaveBarState and CFrameWnd::LoadBarState
|
|
|
|
|
i would like to know how we could convert a long to a string?
And, if i have a double, which have to be a long, how could i do that?
thanks in advance
gerald
|
|
|
|