|
I've used the following code to create the toolbar window:
<br />
hToolbar = CreateWindowEx(0,TOOLBARCLASSNAME,"MyToolbar",CCS_ADJUSTABLE|WS_CHILD|WS_VISIBLE|TBS_TOOLTIPS,0,0,0,0,hWnd,0,g_hInstance,NULL);<br />
SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);<br />
SendMessage(hToolbar,TB_SETBITMAPSIZE, 0,(LPARAM)MAKELONG(32,32));<br />
SendMessage(hToolbar, TB_AUTOSIZE,0,0);<br />
I've added some bitmaps to the toolbar using several calls of
<br />
SendMessage(hToolbar,TB_ADDBITMAP,1,(LPARAM)&bit);<br />
with bit of type TBADDBITMAP
Finally added all my buttons to the toolbar using
<br />
SendMessage(hToolbar, TB_ADDBUTTONS, NUMBEROFTOOLBARBUTTONS, (LPARAM)&tbb);<br />
I've added 5 buttons to the toolbar. The toolbar is perfectly visible and I've even managed to show a toolbar for each button by returning the appropriate data in the TTN_GETDISPINFO notification message.
Now when I send the TB_CUSTOMIZE to the toolbar, I receive following notifications:
TBN_BEGINADJUST: I simply return TRUE here
Then 7(?!: I have only five buttons) TBN_QUERYINSERT notification
I've printed the iItem value of the structure NMTOOLBAR for each notification:
iItem = 5
iItem = 5 (why is this one send twice)
iItem = 4
iItem = 3
iItem = 2
iItem = 1
iItem = 0
I return TRUE for each TBN_QUERYINSERT.
And finally I get the notification TBN_ENDADJUST.
Now where did the notifications TBN_QUERYDELETE and above all TBN_GETBUTTONINFO gone too??
I hope someone can help me out here,
kind regards,
Ward
|
|
|
|
|
hello!
Dll or ActiveX is securety for using in any project?
Zo.Naderi-Iran
|
|
|
|
|
zoncpp25 wrote: Dll or ActiveX is securety for using in any project?
I don't understand your question properly, if you want to secure your DLL or activex component then this link will help :-
http://www.siliconrealms.com/armadillo.htm[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hello every one.
my question may look *stupid*, but i'm completely aware of this.
i'm looking for a grid control that i could use in a MFC project.
As i never nedded grids in MFC before, i never searches for one. it seems that MFC library don't provide any grid control.
i already had a look at Chris Maunder grid, but wondered if there was a simple (very basic) one... i don't need much than lines, columns - and so cells to write in...
anyone ?
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
Hi tox,
I think this will be useful to you.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
argg, i needed very basic tabular control... this one is loosing some space due to its vertical column headers...
but thanks for the link anyway.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
Hey tox !
Maybe you can use the MSFlexGrid ActiveX control ? It is quite simple and will probably do what you need. To use it, go into project -> Add to project (if I remember correctly) and there you have to look a little bit to find the MSFlexGrid control.
|
|
|
|
|
|
Cedric Moonen wrote: there you have to look a little bit to find the MSFlexGrid control.
In MY Personel Opinion i never liked MsFlexGrid... i better use TrueDBGrid for same purpose
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: In MY Personel Opinion i never liked MsFlexGrid
Is that not what Chris said before starting with its own Grid ?
~RaGE();
|
|
|
|
|
Rage wrote: Is that not what Chris said before starting with its own Grid ?
Really, I don't know, I never read that article properly
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
toxcct wrote: why ?
Lack of proper documentation for use in VC++ and very difficult to use and play with (IMHO only )
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: Lack of proper documentation for use in VC++
Yep that's true but when you need to do some very basic operations, you don't really need a good documentation (the functions names talk by themselves ).
|
|
|
|
|
Cedric Moonen wrote: you don't really need a good documentation (the functions names talk by themselves
Some time not! take my case, I have to change selection from one point to other, i am able to do that but don't able to find function which scroll the grid.. i.e. the right row get selected but view doesn't changed
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
The activex grid control is crap.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I created a virtual folder using com/atl app wizard dll.And i implemented contextmenu handlers to that folder.Now i want to specify context menu items before com object loading into my system.Plz tell me how to create context menu handlers dynamically
-- modified at 5:47 Tuesday 10th January, 2006
|
|
|
|
|
kil ramesh wrote: Now i want to specify context menu items before com object loading into my system.Plz tell me how to create context menu handlers dynamically
CreatePopupMenu[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
Hi,
I came across a situation which demands the customization of Insert File and Insert Hyperlink dialogs in MS Office documents(new mail message,word doc etc). These dialog boxes appear when the user clicks on the "Insert->File" or "Insert->HyperLink" menu-item.The dialogs placesbar needs to show up an icon which corresponds to a namespace extension. The events on the list view items where the data of the namespace extension is being shown have to be handled by my application.
Would appreciate help from any one.
Thanks and Regards,
Anil
|
|
|
|
|
hiii...
Is there any MFC fuction by which I can check whether there is a pen drive attach to the USB port.
Thanx in Advance
birajendu
CyberG India
Delhi
India
|
|
|
|
|
Try this:
CString sDrivePath = "c:\\";
UINT nDriveType = ::GetDriveType((LPCTSTR)sDrivePath);
if (nDriveType == DRIVE_REMOVABLE)
{
AfxMessageBox("Removable storage!");
}
If it doesn't work for USB drives, it should at least give you a starting point for finding the right way to do it.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
thanx...
birajendu
CyberG India
Delhi
India
|
|
|
|
|
This is a function that finds all removeable drives in a system, including USB-connected harddrives.
It's not exactly what you asked for, but it works. Feel free to use bits and pieces of it.
The result is stored in the class variable
DWORD fRemovableDrives;
The function returns the number of drives found.
<code>
long CKonfig::GetRemovableDriveCount()
{
// Find units that Windows flags as REMOVEABLE
// Accept USB-hard drives too. And all USB unitsv that can handle data
int i;
char sDrivePath[3];
UINT uDriveType;
DWORD dwDrives;
fRemovableDrives = 0;
int noOfDrives = 0;
dwDrives = GetLogicalDrives();
strcpy(sDrivePath+1, ":\\");
// Loop through the found drives
for(i = 0; i < 32; i++) {
if(dwDrives & (1 << i)) {
// Create sDrivePath
sDrivePath[0] = (char) ('A' + i);
uDriveType = GetDriveType(sDrivePath);
if((uDriveType == DRIVE_REMOVABLE || uDriveType== DRIVE_RAMDISK)) {
// It's a removable or a RAM-DISK(nödlösning), add it to the list
fRemovableDrives |= (1 << i);
noOfDrives++;
}
else {
if(uDriveType == DRIVE_FIXED) {
// DRIVE_FIXED: The disk cannot be removed from the drive.
// Accept DRIVE_FIXED if it's a USB unit
char szBuf[10];
HANDLE hDevice;
PSTORAGE_DEVICE_DESCRIPTOR pDevDesc;
sprintf(szBuf, "\\\\?\\%c:", sDrivePath[0]);
// Open the unit with "zero rights". Works.
hDevice = CreateFile(szBuf, 0,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, NULL, NULL);
if (hDevice != INVALID_HANDLE_VALUE) {
pDevDesc = (PSTORAGE_DEVICE_DESCRIPTOR)new BYTE[sizeof(STORAGE_DEVICE_DESCRIPTOR) + 512 - 1];
pDevDesc->Size = sizeof(STORAGE_DEVICE_DESCRIPTOR) + 512 - 1;
if(GetDisksProperty(hDevice, pDevDesc))
{
if(pDevDesc->BusType == BusTypeUsb)
{
// It's USB, save it.
fRemovableDrives |= (1 << i);
noOfDrives++;
}
}
delete pDevDesc;
CloseHandle(hDevice);
}
}
}
}
}
return noOfDrives;
}
</code>
Kakan
|
|
|
|
|
See MSDN article Q264203.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|