|
HI,
Wt meassge is generated on window maximmize.
and how it can be handled ....n where ...
any idea .. assume that i want to show a MessageBox
when window is Maximize after minnimizing.
any code or help;
thanx
|
|
|
|
|
catch WM_SIZE in simple SDK or OnSize in MFC and they receive
SIZE_MAXIMIZED
The window has been maximized.
SIZE_MINIMIZED
The window has been minimized.
and other messages....
check MSDN....
|
|
|
|
|
thanx it worksss
Can u answer mine question below here in fourm abut Slider Control
thanx
|
|
|
|
|
HI,
I build my own Video file player.
Now wanaa use CSliderCtrl that will move onwards as the file runs ,,, same as in Windows media player
i looked in code project but this kind of sample not
there.
any sample .. or help code
thanx
|
|
|
|
|
Can you get the timeline of the file?
Then you can synchronize your slider with this.
(adjusting the position every second or something)
you can also try every # of frames of your video. (eg. every 5 frames set next position etc...)
Just ideas hope they help.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
hi,
I have created a Bmp object using GDI+.
Bitmap bmp(400,500);
Now I want to save this Object as Gif File with Different Color Palette.I know that we can save the Gif file like this..
CLSID imageClsid;
GetEncoderClsid(L"image/gif", &imageClsid);
bmp.Save(wst, &imageClsid, NULL);
BUT I want to save the bmp as gif file with DIFFERENT COLOR PALETTE.How do I do that.....
please help me..
|
|
|
|
|
Hi all,
a couple of questions
1)When my process is terminated, say from the taskmanager, what is the callback message I need to use?
2)I assume if my process is being terminated because of a system shutdown I would use WM_ENDSESSION, is this correct?
Thanks again for all your help,
you guys are the greastest,
-bacon
|
|
|
|
|
AmericanBacon wrote:
When my process is terminated, say from the taskmanager, what is the callback message I need to use?
If your process is terminated from taskmanager you don't get any notification at all.
AmericanBacon wrote:
I assume if my process is being terminated because of a system shutdown I would use WM_ENDSESSION, is this correct?
Yes.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I can't believe it. The following line of code takes 30 seconds or more to finish. It does not happen all the time, which is even worse. For most of the time, everything just work fine. But once in a while, the program freeze for half a minute or more. The program log tells that it block at the following line. The worst thing is that I cannot reproduce the problem in my deveoping environment. It just happen on the customer's machine
HICON h = (HICON)LoadImage(0,strFile, IMAGE_ICON, nWidth, nHeight, LR_LOADFROMFILE);
Anybody can help me?
|
|
|
|
|
LoadIcon being a single API-call can hardly have anything to do with this. As much as I hate it in a support situation, this ought to be a problem with the user machine. A further investigation of indexing services, check of background processes, harddisk surface check etc. will probably be more fruitful than staring at the offending line. You might want to check so that the load is made as seldom as possible in your code, however. For example, preloading the icon in a ctor rather than in OnPaint .
|
|
|
|
|
Can we read data to struc directly? Follow coded are OK?
Can we read data to struc directly? Follow coded are OK?
typedef struct tagSTRUC
{
short iVer;
long a[10];
union {
short s[2];
long l;
} Comm;
float f1;
float f2[512];
flaot f3[48];
char name[128];
char nameext;
short ip;
short id;
double ddl;
double dde[256];
char cgap[46];
short dataOK;
}STRUC
void Fun()
{
STRUC mySTRUC, pSTRUC;
FILE *fp;
char fname[] = "fname.txt";
fp = fopen(fname, "r");
int iLength = sizeof(STRUC);
pSTRUC = &mySTRUC;
fread( pSTRUC, sizeof(char), iLength, fp );
/* if the read statement id OK?*/
}
|
|
|
|
|
The best way is not to use C style file handling, but use C++, with iostreams, and write stream handlers for your struct.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I believe he asked if he could do it that way, not a better way to do it.
Try this way...
<br />
#include "stdio.h"
<br />
struct XYZSTRUCT<br />
{<br />
int n1;<br />
double d1;<br />
char c[25];<br />
};<br />
<br />
XYZSTRUCT xyzItem;<br />
int nItemsRead = 0;<br />
<br />
FILE* f = fopen("MyFile.xyz", "rb");<br />
if (f)<br />
{<br />
itemsRead = fread(&xyzItem, sizeof(XYZSTRUCT), 1, f);<br />
fclose(f);<br />
}<br />
if (itemsRead < 1)<br />
{<br />
}<br />
Of course, Christian might be right about his claim that IOstreams are better, but sometimes, something quick and dirty like this are called for.
Keep in mind that you should stick with standard C++ types and not use MFC types when you're doing it this way.
------- 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
|
|
|
|
|
Hi all,
I am fixing some defects in a huge code base, There's a function, say, func1 ()in which after even a long investigation, I am unable to find which function of the code base calls this function..
I there any way to find this out..This code has got multiple threads..can somebody suggest any free tool which can show the function call stack or any other means of finding this out..
Thanks,
Shiva P
|
|
|
|
|
one tool will do both of these things for you. It's from Microsoft and it's called Visual Studio. It will search for the function call across an entire project ( actually, Microsoft Windows is also worth checking out, it'll search all the text within a directory structure for you ), and if you put a breakpoint in your function and run in debug mode, you'll be able to see a call stack.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
if you want to do it programmatically, You can try looking at StackWalk
msdn online has This[^] to say about it
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Can you not set a breakpoint in func1() , and then check the call stack once the breakpoint has been reached?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hi all i need help
i can get the Thread current process but i don't know how to get the information of the window was created by the Thread like (window caption, control in that window....) the same Spy++ tool of VS when we click the Thread(Ctrl+T) button on toolbar.
Thank so much
|
|
|
|
|
MSDN: EnumThreadWindows Function
The EnumThreadWindows function enumerates all nonchild windows associated with a thread by passing the handle to each window, in turn, to an application-defined callback function. EnumThreadWindows continues until the last window is enumerated or the callback function returns FALSE. To enumerate child windows of a particular window, use the EnumChildWindows function.
|
|
|
|
|
I'm currently working on a project using RichEditView and I have run into a small but very destructive problem. How do I draw text in the view? I have tried OnDraw and even OnPaint but neither function is called by the program. Please help this poor noob before he kills his computer.
|
|
|
|
|
CRichEditCtrl &ctrl = GetRichEditCtrl();
ctrl.SetWindowText(_T("This is my text!"));
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi there,
I have a group of three checkboxes. When I click on CheckBox2, a dialog box appears asking for user input. What it's suppose to do is when a user cancels a selection it should default to the first checkbox by making a call to CheckRadioButton. It does default but once the user clicks away from the application, the dialog box reappears as if the function to open up the dialog box is called once again. I isolated the problem and found that its the CheckRadioButton() that performs the recursive calls. How can I stop it from doing that? Thanks.
void CCheckBox::OnCheckBox2
{
CMyDialog dlg;
int nRet = -1;
nRet = dlg.DoModal();
// Handle the return value from DoModal
switch ( nRet )
{
case -1:
AfxMessageBox("Dialog box could not be created!");
break;
case IDOK:
{
..code...
break;
}
case IDABORT:
{
OnCheckBox1();
break;
}
case IDCANCEL:
{
OnCheckBox1();
break;
}
default:
break;
};
}
void CCheckBox::OnCheckBox1()
{
CheckRadioButton(IDC_RADIO1, IDC_RADIO3, IDC_RADIO1); //problem lies here
}
|
|
|
|
|
elephantstar wrote:
...when a user cancels a selection...
Cancels what selection?
elephantstar wrote:
...once the user clicks away from the application...
Closes the application, or puts focus on another application?
elephantstar wrote:
CheckRadioButton(IDC_RADIO1, IDC_RADIO3, IDC_RADIO1);
While I don't think it is related to the problem, are the values for IDC_RADIO1 , IDC_RADIO2 , and IDC_RADIO3 contiguous?
Why are you using CheckRadioButton() with checkboxes and not radio buttons?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
-When the user selects cancel (CASE IDCANCEL) in the popup dialog box, it would call OnCheckBox1() to check the first radio button. The first button is the default selection.
-Puts focus on another application.
-The radio button values are contiguous. The buttons are radio buttons not checkboxes. Sorry to confuse you with the names.
|
|
|
|
|
elephantstar wrote:
-When the user selects cancel (CASE IDCANCEL) in the popup dialog box, it would call OnCheckBox1() to check the first radio button. The first button is the default selection.
Blake's suggestion is definitely the cleanest. Assign each of the radio buttons a CButton member variable (e.g., m_btnRadio1, m_btnRadio2, m_btnRadio3). Something like:
void CCheckBox::OnCheckBox1( void )
{
m_btnRadio2.SetCheck(BST_UNCHECKED);
m_btnRadio3.SetCheck(BST_UNCHECKED);
}
void CCheckBox::OnCheckBox2( void )
{
CMyDialog dlg;
int nReturn;
nReturn = dlg.DoModal();
if (IDABORT == nReturn || IDCANCEL == nReturn)
m_btnRadio1.SetCheck(BST_CHECKED);
else
m_btnRadio1.SetCheck(BST_UNCHECKED);
m_btnRadio3.SetCheck(BST_UNCHECKED);
}
void CCheckBox::OnCheckBox3( void )
{
m_btnRadio1.SetCheck(BST_UNCHECKED);
m_btnRadio2.SetCheck(BST_UNCHECKED);
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|