|
Giorgi Moniava wrote:
Yes right !
Now you can implement same by using this logic,I Believe you starting you Application at windows startup using key stored in Registry location RUN .
Now to distinguish wheather the USer is Starting the Program by Clicking over it or Windows is Starting it at start up, you just provide a command line argument to that reg Location i.e. store application path as
c:\\your_app_path\\app.exe -hidden
Now When ever Windows start your application at startup offcourse, you will get -hidden as commandline argument, now you just have to parse the command line [use GetCommandLine() : to retrieve command line arguments]to hide or unhide your application.
There can be other solution also, It's upto you to choose better one.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I've also thought about that , but i did'nt know this function GetCommandLine().
Thanks, so you say that when i add the value to regedit (for my app started at startup) , in my value settings i'll simply write as progra path :
"c:\\myapp.exe -hidden" , and then when i call CommandLine() in OnInitDialog(), if it returns "hidden" , it means my app's started at startup.
Thanks i'll try it
m0n0
|
|
|
|
|
Giorgi Moniava wrote:
when i call CommandLine() in OnInitDialog(), if it returns "hidden" ,
Nope, It will return Application path + Command line Arguments, Something like this "c:\\myapp.exe -Hidden" .
From it,You have manually parse the "-Hidden" command line argument.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Yes , i've already done it and it works.
Thanks for help
m0n0
|
|
|
|
|
Giorgi Moniava wrote:
Thanks for help
It's my great Pleasure !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
My application in my view, is getting quite large, now I have just got a Stack Overflow when I added new code.
If I comment out this new code, the program run OK.
Are they any setting that I can make to increase the programs parameters like Stack size etc to allow me to continue to add to this program.
Note the point in the code that causes the Stack Overflow is a bit strange in the debugger; a simple if statement keeps looping like a while loop.
Any comments please.
|
|
|
|
|
i'd advise you to split your code into functions you could include into DLLs...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Are you saying that they are no settings that I an make.
I will do a re-design later, but need this phase to continue.
I assume I have the default settings for Visual Studio (V7.1) being applied.
|
|
|
|
|
|
The default stack size is 1MB. Check out the linker's /stack option.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Hi
I am writing a software for a STAND-ALONE SYSTEM which should expire exactly after 30 DAYS.
The problem is i have to compare my installation date with the system clock , which can be changed easily .... effectively the user can run the software forever if he keeps changing the system date back.
The only solution i see is ... logging the time and date at regular intervals to a file ... probably encrypt it .
but that will also fail ...
Is there ANY other way?
Adithya H A
|
|
|
|
|
|
I have edit controls in the property page.How can I capture the OnChar event for the edit controls.
I was told to do that by deriving CEdit class and capturing the OnChar event then.Can anoyone clarify exactly how this can be dealt with.
laiju
|
|
|
|
|
Look for control sub-classing in MSDN
« Superman »
|
|
|
|
|
laiju wrote:
I was told to do that by deriving CEdit class and capturing the OnChar event then.Can anoyone clarify exactly how this can be dealt with.
Use ClassWizard (Ctrl+W) to derive a new class from CEdit .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I have inherited a class from CEdit as show below
class CEditValidate : public CEdit
{
DECLARE_DYNAMIC(CEditValidate)
public:
CEditValidate();
virtual ~CEditValidate();
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
};
Now can u let me know how I can use this OnChar handler for validating the characters keyed into the edit control in my property page.
laiju
|
|
|
|
|
laiju wrote:
Now can u let me know how I can use this OnChar handler for validating the characters keyed into the edit control in my property page.
Simply modify that method to allow/disallow the characters. You did not specify what characters you wanted to keep/discard.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I get what you say. But the OnChar handler is not invoked at all when I type characters into the Edit control in my property page. I dont understand how to use the newly inherited class for my edit control in the property page.
laiju
|
|
|
|
|
laiju wrote:
But the OnChar handler is not invoked at all when I type characters into the Edit control in my property page.
Probably because you are not using the newly created class. Modify the page's .h file to use it instead of CEdit .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I understood the concept now.
I changed CEdit to the class I newly inherited .
I manually changed them as below and it works.
CEditValidate m_Width;
CEditValidate m_Height;
Thanx once again.
laiju
|
|
|
|
|
Hi everybody,
I have drawn a line with LineTo.
Now, I want to perform the functionality that if I click upon the Line, it will write a TRACE saying : OK, you have clicked upon it... I mean, I want to know how to know if a point belongs or not a line. I have to do the same with several lines,distinguishing them from the others.
Thanks you very much
Javi
|
|
|
|
|
You have the line coordinates (x1 , y1 ) & (x2 , y2 ). You can store this parameters in a linked list of all the lines and traversing the list. Now you have a point say (x , y ) and you want to check that it belongs to the line or not. You can use the equation:
y2 -- y1
m = -----------
x2 -- x1
if((y - y1) == (m ( x - x1)))
Point lie on line.
http://www.priyank.in/
|
|
|
|
|
|
You could use the line function as suggested by Priyank or you could
simply use GetPixel() on the cursor coordinates and test the RGB value
returned to see if it matches the color you used to draw the line.
Steve T
|
|
|
|