473,408 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

get a window not a console

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?
Jul 3 '08 #1
28 1533
On Jul 3, 5:07 pm, Jrdman <ahmed.bo...@gmail.comwrote:
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.
Jul 3 '08 #2
[Cross-posted to comp.os.ms-windows.programmer.win32 and Followup-To set to
that group.]

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?
#include <comp.os.ms-windows.programmer.win32>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jul 3 '08 #3
Jrdman wrote:
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.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jul 3 '08 #4
jacob navia said:
Jrdman wrote:
>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.
There's a lot more to it than that, as you ought to know.
If you use lcc-win
More self-serving spam, I see - even though he already told you he's using
mingw. And you know perfectly well (or ought to) that he'll get better
answers in a Windows group.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jul 3 '08 #5
Jrdman wrote:
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?
Just change WinMain to NoWinMain.

--
pete
Jul 3 '08 #6
On Jul 3, 6:38*pm, pete <pfil...@mindspring.comwrote:
Jrdman wrote:
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?

Just change WinMain to NoWinMain.

--
pete
thanks pete
Jul 3 '08 #7
Jrdman <ah*********@gmail.comwrites:
On Jul 3, 6:38*pm, pete <pfil...@mindspring.comwrote:
>Jrdman wrote:
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?

Just change WinMain to NoWinMain.

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.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <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"
Jul 3 '08 #8
On Jul 3, 10:16*pm, Keith Thompson <ks...@mib.orgwrote:
Jrdman <ahmed.bo...@gmail.comwrites:
On Jul 3, 6:38*pm, pete <pfil...@mindspring.comwrote:
Jrdman wrote:
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?
Just change WinMain to NoWinMain.
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.)

--
Keith Thompson (The_Other_Keith) ks...@mib.org *<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
Jul 3 '08 #9
Jrdman wrote:
pete <pfil...@mindspring.comwrote:
>Jrdman wrote:
>>what's the minimum code should i add to this code:
#include<windows.h>
int APIENTRY WinMain(HINSTANCE hinstane,
.... snip ...
>>
>>to get a window not a console?

Just change WinMain to NoWinMain.

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.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Jul 4 '08 #10
Keith Thompson wrote:
Jrdman <ah*********@gmail.comwrites:
>On Jul 3, 6:38 pm, pete <pfil...@mindspring.comwrote:
>>Jrdman wrote:
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?
Just change WinMain to NoWinMain.
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.)
I think we should argue about it.

--
pete
Jul 4 '08 #11
pete <pf*****@mindspring.comwrites:
[...]
I think we should argue about it.
No, we shouldn't!

--
Keith Thompson (The_Other_Keith) ks***@mib.org <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"
Jul 4 '08 #12
Jrdman wrote:
On Jul 3, 10:16 pm, Keith Thompson <ks...@mib.orgwrote:
>Jrdman <ahmed.bo...@gmail.comwrites:
>>On Jul 3, 6:38 pm, pete <pfil...@mindspring.comwrote:
Jrdman wrote:
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?
Just change WinMain to NoWinMain.
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.)
i did not believe him ,i thanked him cuz "maybe" this act will prevent
him from doing such behavior next time
u mispled "mAB"

--
pete
Jul 4 '08 #13
Keith Thompson said:
pete <pf*****@mindspring.comwrites:
[...]
>I think we should argue about it.

No, we shouldn't!
That's not arguing - it's just contradicting.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jul 4 '08 #14
Richard Heathfield wrote:
Keith Thompson said:
>pete <pf*****@mindspring.comwrites:
[...]
>>I think we should argue about it.
No, we shouldn't!

That's not arguing - it's just contradicting.
He's against arguing.
He's playing it double reverse straight man.

--
pete
Jul 4 '08 #15
jacob navia wrote:
pete wrote:
<snip>
>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?
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
Jul 4 '08 #16
jacob navia wrote:
Who are you to say me what do I write what I don't?
Freedom of speech, guarantees my Right To Censor.

http://en.wikipedia.org/wiki/Right_to_Censor

--
pete
Jul 4 '08 #17
Hello Pete, List

On Jul 4, 10:44*am, pete <pfil...@mindspring.comwrote:

Pete, ¿Por qué no te callas?

http://en.wikipedia.org/wiki/%C2%BFP...o_te_callas%3F

Regards
Rafael
Jul 4 '08 #18
Richard Heathfield <rj*@see.sig.invalidwrote:
Keith Thompson said:
pete <pf*****@mindspring.comwrites:
[...]
I think we should argue about it.
No, we shouldn't!

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
Jul 4 '08 #19
soscpd wrote:
Hello Pete, List

On Jul 4, 10:44 am, pete <pfil...@mindspring.comwrote:

Pete, ¿Por qué no te callas?
Because topicality enforcement is tedious
and it's wrong for me to reap the benefit
without participating.

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?"

--
pete
Jul 4 '08 #20
la************@siemens.com writes:
Richard Heathfield <rj*@see.sig.invalidwrote:
>Keith Thompson said:
pete <pf*****@mindspring.comwrites:
[...]
I think we should argue about it.

No, we shouldn't!

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

Are you implying that contradicting isn't arguing?
Yes and no.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <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"
Jul 4 '08 #21
On 4 Jul 2008 at 19:08, pete wrote:
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.

Jul 4 '08 #22
Antoninus Twink wrote:
On 4 Jul 2008 at 19:08, pete wrote:
>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.
Who are you to say me what do I write what I don't?

--
pete
Jul 4 '08 #23
On 4 Jul 2008 at 19:36, pete wrote:
>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.

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.

Jul 4 '08 #24
pete said:

<snip>
Who are you to say me what do I write what I don't?
Maybe your plans have something to do with this.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jul 4 '08 #25
la************@siemens.com wrote:
Richard Heathfield <rj*@see.sig.invalidwrote:
Keith Thompson said:
pete <pf*****@mindspring.comwrites:
[...]
>I think we should argue about it.
>
No, we shouldn't!
That's not arguing - it's just contradicting.

Are you implying that contradicting isn't arguing?
Go over to Complaints.


Brian
Jul 4 '08 #26
Antoninus Twink wrote:
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.
That would be like watching PBS and not sending in any money.

--
pete
Jul 5 '08 #27
On 4 Jul 2008 at 23:55, pete wrote:
Antoninus Twink wrote:
>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.

That would be like watching PBS and not sending in any money.
No, it would be like watching PBS and not sending in any hate mail.

Jul 5 '08 #28

"Jrdman" <ah*********@gmail.comwrote in message
news:3e**********************************@a1g2000h sb.googlegroups.com...
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).

--
Bartc

Jul 7 '08 #29

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: BlackHawke | last post by:
Our program, game program Andromeda Online (www.andromedaonline.net) uses two programs- one to play the game, another to patch the game as updates come out. Players actually launch the updater...
11
by: objectref | last post by:
Hi to all, i have a window app and i want to display some info in a console window. I figured out (after a very long search...) how am i supposed to do it and i try using the following code. ...
8
by: Mészáros Tamás | last post by:
Hi all, how can I set an app's main window to visible from an other application? My problem is, that I know only the handle of the other app's main process, because the application's main window...
0
by: Mythran | last post by:
I can draw onto the console window where I want using a mixture of API calls and the System.Drawing namespace (.Net 1.1). I am trying to install hooks for the window to catch a resize or another...
7
by: Abelard | last post by:
How do I programmatically minimize the console window in a VB .NET console application?
10
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden...
12
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am using the following command to output my results to the Output window (for testing things out). Console.WriteLine ("Output") I'd like to clear the Output window of any previous output. I...
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.