|
Hi
I have a static control stretched to a big rectangle and i want to scroll in that control, so i was thinking of doing that using the scrollbar functionality of the CWnd derived controls.
I derived a CStatic class called CCanvas;
I did a call to CCanvas::EnableScrollBar() and both a hor. and a vert. scrollbar which were not grayed out appeared. But i cannot move them nor receive messages from them (according to Spy++).
Does anybody know how to enable those scrollbars and use them??
Joris Mans
|
|
|
|
|
I want to change the font of the icons on the desktop. I use this function that wraps SystemParametersInfo:
inline BOOL SPI_SetIconMetrics( ICONMETRICS pIconM, UINT Update )
{
pIconM.cbSize = sizeof( ICONMETRICS );
return( ::SystemParametersInfo(
SPI_SETICONMETRICS,
sizeof( ICONMETRICS ),
&pIconM,
Update ) );
}
I use a valid ICONMETRICS structure and SPIF_SENDCHANGE (documented in MSDN) as Update parameter. Nothing happens on the desktop, but:
1) The font changes in other windows, for example in the icons displayed in My Computer;
2) In Desktop Properties, in the page where you change system colors, the new font for icons is reported correctly. But icons change only if I click on Apply.
How can I update my icons? Note: Accessing desktop as a CWnd and using UpdateWindow, Redraw ecc. does not work.
Any help will be appreciate.
Marakid
|
|
|
|
|
I'm looking for a way to code something like these beautiful roll-up controls in 3ds max.
Any help ?
Thanks
Roms.
|
|
|
|
|
The idea is to use a page concept. Each page is based on a CDialog, and has a IDD referencing the dialog template you want.
When each page is added to the control (similar to the PropertySheet::Addpage function) , make it the child of a container window that contains the show/hide button and group border. This container is in turn a child window of the actual control.
When a container button is pressed, just show or hide the page window as appropriatte, and resize the container to the 'hidden' size.
When something happens to change the look of the control, such as one of the container buttons being pressed, or scrolling of the control contents, call a layout function that moves the container windows around (normally just a vertical re-positioning) so that the pages look like they are opening and closing.
Thats the basic concept, I have some code for this lying around if you really want it, its not generic, but it works.
|
|
|
|
|
Finally I found a * really * good solution. If you want, I can Email you the code source.
I use the following architecture :
CRollboxCtrl : public CDialog
- AddPage(CGroupCtrl *)
- ShowPage(int page_index)
- HidePage(int page_index)
This is the whole Control... (including the groups which are my 'property pages')
CGroupCtrl : public CDialog
(DECLARE_DYN_CREATE)
Each "property" page is derived from this class...
CPropertyPage : public CGroupCtrl
The property class... Just create a CDialog with Class Wizard and replace each "CDialog" by "CGroupCtrl"...
So, it's easy to create a control box.
It's owesome ! that's really cool, I spend just 1 day to make this control, and it's nice (even nicer than the controls in 3ds max).
The only drawback is that I can figure out how to create a CScrollBar control to scroll the groups in the controls.
My Email is Roms@usa.com and I would be glad to send you the actual code if you wanna take a look.
Roms
|
|
|
|
|
Hi,
I'd like to know if there's a way to play AVI files from memory using the AVIFile functions?
All I found from Net was a Win32 SDK document Q155360:
"HOWTO: Use MCI to Play AVI/WAVE Files from Memory"
(can be found from online MSDN) which explains how to play AVI files from mem using the MCI (media control interface).
I'm more interested to get the actual bytes of each frame of the AI files. Using the AVIFile functions I can do that, but the MCI wont do that.
I tried to use the method decribed in the document Q155360, but all I got was a Access Violation in avifil32.dll.
I know how to make a custom AVIStream, but I would not like to parse the AVI file myself. Instead I'd prefer similar trick as the forementioned document suggests. Saving the AVI to a temporary file is out of question. Any ideas?
Thanks...
--memon
|
|
|
|
|
Hi there,
I have an activeX control and in it, I do handle the VK-BACK on KeyUp. However, even when I am clicking on an item on the ActiveX, when I click backspace, IE switches to the previous page.
How do I completely and fully suppress the backspace, so my pages don't change on me?
thanks!
|
|
|
|
|
Folks,
I have an urgent need to add a 32-bit ActiveX control (OCX) to a VC++ DLL,then instantiate and access this OCX only from the DLL. The current DLL doesn't contain any visible Windows or CWnd objects in which to host the component.
However, it does contain a main application object (CWinApp). Is this possible or do I have to provide a form and then hide it from the user.
If possible, I would like to avoid the later scenario. Can someone provide me with an example of this or point me to a source explaining this concept. It seems that any events fired by the control wouldn't be available to my app, and this is fine.
Thanks in advance for any consideration and help in solving this problem.
|
|
|
|
|
Any idea or tutorial on how to create a NetDDE Client and Server in Visual C++.
|
|
|
|
|
Any idea or tutorial on how to create a NetDDE Client and Server in Visual C++.
|
|
|
|
|
Problem with using Microsoft G.723.1 codec in Graph Builder: can't build working graph with this codec. While building graph in Graph Builder this codec reports in WaveFormatEx 0 bits on output pin all the time
|
|
|
|
|
* In the ame of god *
Question 1:
If it's possible please write a program included a main window and in this window two buttons .
First button open the window in MDI case
and second button open the window in SDI case.
Please try with App Wizard.
Question 2:
I saw a program that in it a window is runed in Document case. But it has used CWnd class . How is it possible ?
This program had been written with App Wizard.
Question 3:
What is different between DirectX and OpenGL
and Which is best ?
Iran - Tehran - Hadi Rezaie
My E-mail : Hadi_Rezaie@hotmail.com
Thank You ...
|
|
|
|
|
I have a query releated to obtaining license number for executables on Windows platform.
On Windows, most of the applications will have a licence number associated with them. (for ex: if we go to explorer and obtain properties for an .exe, it might have the license number listed out).
I want to determine this license number programmatically.
This information is not available even in the program header of the .exes. Please let me know if there is any other source of retrieving this information (either registry or some API or some other way out....)
Thanking you in anticipation
Raj
|
|
|
|
|
You need to look at the VerQueryValue() API.
Its documented on MSDN. Complete with a trivial code
sample. You'll need to tweak it slightly to get what
you want
Stephen Kellett
|
|
|
|
|
I have always thought that a static library was just like collection of .obj files.
However, I recently tryed to seperate a bit of functionality from my app by, moving the files out and building them into a static .lib.
My problem when I do that is I now get all sorts of library conflicts when the main app links.
Is there more to static librarys than I realise?
|
|
|
|
|
Did you delete the .obj files of the files that were put into the static lib project?
Could you be a little more specific as to what library conflicts you are getting.
|
|
|
|
|
The conflicts were all standard librarys, like libcd.lib and libcmtd.lib, and some of the afx ones. I can't remember the exact names.
Thinking about it some more I think a possibility maybe is that it could have to do with some of the afx includes explicitly linking. Do they do that? If thats the case, then how do I get the static library to link with the same librarys as the main app, and if not ...
|
|
|
|
|
Ok, I've just learnt something new about VC. You can set the library type you want to link under C++/Code Generation.
Changed all my dependant libraries to the same as the main app and it works perfectly...
|
|
|
|
|
I have to build a small database that will be used by a VC++ application and I don't know a lot about creating a DB under Windows and interacting with it. I also need to use SQL Server and not Access. Does anybody know a good tutorial for this kind of situation because MSDN is really poor on the subject (only uses those crapy .mdb)
Thank you for your attention.
|
|
|
|
|
I have tried RegSaveKey to export HKCU and all its subkeys. In regedit, I export and got a text file. But in RegSaveKey, I got a binary file. Can I get the text file programmatically?
Thanks all!!!!!
|
|
|
|
|
I'd like to get some feedback from you guys about the best/proper way to use bitmasks.
I've seen them used in several ways, the most common I think is to do something like
#define BLAH 0x0001
So I was wondering what is the proper way to use them.
I've seen people use decimal number, hex numbers, ascending, decending, short, long and the list goes on and on.
So let me know what you guys think is a good strong coding practice to get into the habit of.
Thanks!
|
|
|
|
|
Whatever representation you use, they should be const variables rather than preprocessor macros.
Dave
|
|
|
|
|
Hi,
I want OpenDlg with out using any MFC ( like CFileDlg etc)
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.hInstance = AfxGetInstanceHandle();
ofn.lpstrFilter = NULL;
ofn.lpstrCustomFilter = NULL ;
ofn.nMaxCustFilter = 0 ;
ofn.nFilterIndex = 0 ;
ofn.lpstrFile = lpcszFile ;
ofn.nMaxFile = MAX_PATH ;
ofn.lpstrFileTitle = lpcszFileTitle ;
ofn.nMaxFileTitle = MAX_PATH ;
ofn.lpstrInitialDir = NULL ;
ofn.lpstrTitle = NULL ;
ofn.Flags = OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ;
ofn.nFileOffset = 0 ;
ofn.nFileExtension = 0 ;
ofn.lpstrDefExt = NULL ;
ofn.lCustData = NULL ;
ofn.lpfnHook = NULL ;
if( !GetOpenFileName(&ofn) )
I did not the openDialog.
can any body tell me where was the wrong?
Thanks,
-- Koteswara
|
|
|
|
|
i have a problem with the FlexGrid .
it causes the rc file to double each time i make the tiniest change in the size or even position of the grid on the Dlg.
help help help
adi peer
|
|
|
|
|
Can I have a CListCtrl in report view, and prevent the user from resizing the columns?
|
|
|
|