get a window not a console

J

Jrdman

what's the minimum code should i add to this code:
#include<windows.h>
int APIENTRY WinMain(HINSTANCE hinstane,
HINSTANCE hpinstance,
LPSTR lpcmdline,
int cmdshow){

while(1)
;


}

to get a window not a console?
 
V

vippstar

what's the minimum code should i add to this code:
#include<windows.h>
int APIENTRY WinMain(HINSTANCE hinstane,
HINSTANCE hpinstance,
LPSTR lpcmdline,
int cmdshow){

while(1)
;

}

to get a window not a console?

Not related to C. Try a windows programming newsgroup.
 
J

jacob navia

Jrdman said:
what's the minimum code should i add to this code:
#include<windows.h>
int APIENTRY WinMain(HINSTANCE hinstane,
HINSTANCE hpinstance,
LPSTR lpcmdline,
int cmdshow){

while(1)
;


}

to get a window not a console?

You have to register a class of windows, then call
the CreateWindow procedure.

If you use lcc-win you get all the code generated
for you by the wizard when creating a project.

You can see how that works if you read the tutorial
that is distributed with lcc-win.
 
K

Keith Thompson

Jrdman said:
thanks pete

The fact that you thanked him makes me suspect that you believed him.

I'm fairly sure there's no such thing as "NoWinMain"; pete was pulling
your leg. (Humor doesn't always survive transmission across a
plain-text medium like Usenet.)
 
J

Jrdman

The fact that you thanked him makes me suspect that you believed him.

I'm fairly sure there's no such thing as "NoWinMain"; pete was pulling
your leg.  (Humor doesn't always survive transmission across a
plain-text medium like Usenet.)

--
Keith Thompson (The_Other_Keith) (e-mail address removed)  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"- Hide quoted text -

- Show quoted text -

i did not believe him ,i thanked him cuz "maybe" this act will prevent
him from doing such behavior next time
 
C

CBFalconer

Jrdman said:
thanks pete

If you hadn't foolishly changed the subject of your thread you
would have seen other, more accurate, answers, and would possibly
know that Petes answer is pure nonsense.
 
J

jacob navia

pete said:
To be clear on this issue;
I have no respect for bona fide attempts to answer OP's question
with anything other than redirection to another newsgroup.

I do not respect you at all then.
Why should I?

Who are you to say me what do I write what I don't?

OP has shrugged off topicality before (hence no redirection from me):

No. He asked a question and I answered.
a demonstration of one of the possible problems
associated with answers to off topic question
was in order.

Demonstration done. So what?
I repeat:

I will answer any question I like answering here.
 
J

Joachim Schmitz

jacob said:
pete wrote:

I do not respect you at all then.
Why should I?
Do you really miss the difference between (not) respecting a _person_ and
doing the same on a 'bona fide attempt', i.e. a message, here?

Bye, Jojo
 
L

lawrence.jones

Richard Heathfield said:
Keith Thompson said:


That's not arguing - it's just contradicting.

Are you implying that contradicting isn't arguing?

-- Larry Jones

Please tell me I'm adopted. -- Calvin
 
A

Antoninus Twink

Because topicality enforcement is tedious

I agree. And I can see a simple solution for you...
Or, in the words of someone who has no respect for me:
"Who are you to say me what do I write what I don't?"

He's 100% right. This isn't comp.lang.isoc.moderated - it's up to each
person to decide what they post, and whether they agree that "C" and
"the ISO C standard" should be considered synonymous.
 
A

Antoninus Twink

Who are you to say me what do I write what I don't?

I think you should write whatever you want, whatever you think is
appropriate. I did no more than observe that if you find topicality
enforcement tedious, then a way of avoiding tedium is not to (try to)
enforce topicality.
 
B

Bartc

Jrdman said:
what's the minimum code should i add to this code:
#include<windows.h>
int APIENTRY WinMain(HINSTANCE hinstane,
HINSTANCE hpinstance,
LPSTR lpcmdline,
int cmdshow){

while(1)
;


}

to get a window not a console?

This group only discusses a C language which has an unspecified input (eg
papertape reader) and an unspecified output (eg a teletype).

So even discussion of keyboards and screens is off-topic!

So a win32 group is best although you may find that your compiler, and the C
language, are off-topic there...

To get started, you need a minimalist program in C that just creates a
window. Try looking for "hellowin.c" or anything by Petzold.

If compiling with gcc, try using the -mwindows switch if there are problems
(this is one of those things you need to pick up from anywhere other than
the gcc help files, which are totally useless for or a beginner).

If using dev-cpp as you mentioned elsewhere, all you need to do is a choose
a new 'Windows Application' project! This will give you exactly what you
need (it didn't work when I tried it, but I'm not an IDE expert; if you have
the same problem, extract the code they give you into a separate file and
compile that).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top