|
It WORKS!!!
Weeeeee!! I love ya!! (don't missunderstand me )
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
hi there,
just need a little help. In Visual C++, there is a tool in the toolbar that enables you to insert a picture box but not the actual picture itself. It doesn't allow you to find the picture right away. Im guessing you have to use some kind of function on the OnPaint() but im not sure how to. Can somebody please help me?
|
|
|
|
|
If you mean the picture control I can help. If you want to specify the pic at run time just change the type from frame to bitmap/icon (whatever one you are using) and change the image field to the resouce ID of you pic. If you want to load it while the app is running (i.e. Change it) I have that too but I can dig it out for you this afternoon.
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
I'm a little fuzzy on what to do. Can you maybe explain things a little more and go into detail better? If you want you can e-mail me at bh_bad@hotmail.com
|
|
|
|
|
I sent you an email with a jpg screen shot and hopefully clear help.
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
Hey. In an apwizard MFC app there is a menu item to show and hide the default toolbar and status bar. How would i make another menu item to hide a new toolbar added by myself.
I have tried the .....
void CMainFrame::OnShowAllBar()
{
// TODO: Add your command handler code here
m_bColorVisible = !m_bColorVisible;
ShowControlBar(&m_wndAllBar,m_bColorVisible,FALSE);
}
void CMainFrame::OnUpdateShowAllBar(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->Enable();
pCmdUI->SetCheck();
}
...way of doing it but it will only hide the toolbar when i click the menu item twice.
Another way would be very much appreciated.
.NET or not .NET? MFC is the question......
|
|
|
|
|
void CMainFrame::OnShowAllBar()
{
// TODO: Add your command handler code here
m_bColorVisible = !m_bColorVisible;
ShowControlBar(&m_wndAllBar,m_bColorVisible,FALSE);
RecalcLayout();
}
void CMainFrame::OnUpdateShowAllBar(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->Enable();
pCmdUI->SetCheck(m_bColorVisible ? 1 : 0);
}
|
|
|
|
|
That hasnt worked for some reason. HOwever I think i may have a way around it. How can i get the current state of a toolbar in a variable whether bool or int.
Like
m_myVar = ...state of bar....;
.NET or not .NET? MFC is the question......
|
|
|
|
|
BOOL bVisible = ((m_wndMyBar.GetStyle() & WS_VISIBLE) != 0);
|
|
|
|
|
Why doesn't BN_CLICKED work when I try to handle a click event on a CStatic control that shows a bitmap??
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Try setting the SS_NOTIFY style for the CStatic and handling STN_CLICKED instead.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Damn thank you!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
By chance, does anyone know how to cancel a printer call IF there is no printer or if it can not print due to no pare or whatever?
Thanks
|
|
|
|
|
I was wondering if there is anyway to run a exe and then for it NOT to have a button on the task bar? I want to have my main program run a separate program which will be shown and hiden from that program only.
Also, if I only want to be able to start an instance of this program once, is the best way adding a semaphore? Then I would show and hide by sending messages to it via a stored ptr to the process?
Last question. I have a problem with setting my program as the topmopst window. When I do this, if I then try ot print and if the printer is not there, the dialog that cancles the job is not shown because it it beneath this. How would I deal with this? I have tried to deal with it via checking the printer but I have not found a way to do it. The other way would be to deal with the topmost window issue.
Thanks in advance. Appreciate any bits and help.
|
|
|
|
|
Dont know if this works, but try to configure your window as a child window, with the desktop as its parent. You can get the parent's HWND by using GetDesktopWindow().
|
|
|
|
|
I think you can try ModifyStyleEx(WS_EX_TOOLWINDOW,0,SWP_FRAMECHANGED) to prevent the main window of your program from appearing in the taskbar.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Make you primary window the child of a top level invisible window.
Nish
Bow wow wow,
Yippee yo yippee yay,
My miniputt high,
Is now 30 yay.
|
|
|
|
|
Hi,
I'm looking for a way to launch VBScript from external application.
Actually the whole idea is to add toolbar to the visual studio environment (which I already did) and open a dialog to collect information from the user and then generate VBScript macro code according to this information and then execute the new macro.
I stuck in the last stage of launching the macro.
If you have any idea's I'll be grateful.
Thanks
Didi Gurfinkel
|
|
|
|
|
Hello,
i am trying to make a small benchmark application to figure out how much resources the programs i write consume, and i wonder what is the best way to do it.
I curently use the windows performance counters that are accessed via the registry base.
For exemple, to retrieve infos about the memory, i open the "VMM" perf counter, and query the values i need...
But, there is at least another way to do it :
using the GlobalMemoryStatus (MEMORYSTATUS mem_stat); function provided by Windows.
So, i would like to know what is the best way to go ? and what are the diferences between these two methods ?
Are there other ways to do this ? are they better ?
Thanks in advance,
Lion.
|
|
|
|
|
Hello
Anybody knows how to run program EXE from
resources having it loaded.
Without previous saving on disk.
Thanks
Konrad
|
|
|
|
|
Hello Konrad,
The source below shows how you can load the binary data of an EXE stored as a resource. After saving it to disk, you can run it via CreateProcess(), etc. The example saves CALC.EXE as resource type "EXEBIN" and of name "EXEBIN_CALC".
However, if you already know how to load a binary resource already and your aim is to run the binary data directly from memory, I do not think this would be possible.
With careful plumbing, you may be able to load some binary code from your EXE/DLL resource and execute it. This would still entail quite a number of restrictions, however.
#include <windows.h>
#include <stdio.h>
void main()
{
HRSRC hResourceThis = NULL;
HGLOBAL hGlobalResource = NULL;
LPVOID lpvResource = NULL;
DWORD dwLastError = 0;
hResourceThis = FindResourceEx
(
(HMODULE)NULL, // resource-module handle
(LPCTSTR)"EXEBIN", // pointer to resource type
(LPCTSTR)"EXEBIN_CALC", // pointer to resource name
(WORD)MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) // resource language
);
if (hResourceThis)
{
hGlobalResource = (HGLOBAL)LoadResource
(
(HMODULE)NULL, // resource-module handle
(HRSRC)hResourceThis // resource handle
);
lpvResource = LockResource (hGlobalResource);
if (lpvResource)
{
FILE* fpw = NULL;
fpw = fopen ("c:\\resource_calc.exe", "wb");
if (fpw)
{
fwrite (lpvResource, sizeof(BYTE), SizeofResource(NULL, hResourceThis), fpw);
fclose (fpw);
}
}
}
if (hResourceThis)
{
CloseHandle (hResourceThis);
hResourceThis = NULL;
}
}
Hope the above helps, Konrad.
Best Regards,
Bio.
|
|
|
|
|
Hi, how do we change control properties on the run time? Say, when I click a button (caption="Start"), the button caption will change to "Stop", or it will hide other controls. And how do we know the legal properties of a control?
It`s so simple if I use VB6 but I don`t know how to do it with VC++. Thanks so much!
Regards,
|
|
|
|
|
You can use the functions GetWindowText and SetWindowText to change the caption of the button. You will want to do this in your handler for the WM_COMMAND message that has the same ID as your button control.
Chances are, that the same properties that you were able to use in VB are available when you program in C++. However, there is no easy way to see the properties that are available for a control. You will need to look in MSDN for more information on each control.
If you want to know how to hide controls you can use:
ShowWindow(hWnd, SW_HIDE);
where hWnd is the control that you want to hide. If you are doing this in a dialog box and you need to get the handle to one of your controls, use GetDlgItem . You pass the handle to the dialog that owns the control, and the control ID to this function, and it will return the handle to the control.
If you want to make that window appear again call:
ShowWindow(hWnd, SW_SHOW);
|
|
|
|
|
I'm trying to create a dialog bar with a tab control on it. Works well, both dialog bar and tab control are in place. Now in order to show something in the tab control, I show/hide dialogs. The problem is that the dialogs are located on the top left corner of the tab control, hiding the tabs. Any suggestions how to solve this?
I do it this way:
TabControl=(CTabCtrl*)DialogBar.GetDlgItem(IDC_TABCONTROL);
TabControl.InsertItem(0,"Test");
Pane1.Create(IDD_PANE1,TabControl);
Pane1.ShowWindow(SW_SHOW);
|
|
|
|
|
I want to know how to process a Word document using VBA.Can you tell me where are the information?thank you!
Besides VBA,which tools can do the same work,SQL?c++builder?
If you can find information about this,please tell me.
For i know little English,I hope you can tell me the particular web sites.Thank you very much!
huang chun shen
|
|
|
|