CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

Comment cree des application Windows ?

nutspower
nutspower
Niveau 9
13 février 2003 à 10:41:49

Voila j ai commencer le C++ avec Dev C++ et je fait des ptit truc que avec le DOS mais j ai vu que l on pourvait cree des truc en application windows ( . exe) , pouvais vous m expliquer vite fait comment on fait ? ?? car c est pas comme en DOS ? ?? enfin j aimerai savoir comment on s en sert ? ??

merci d avance ! , si vous avez des liens je veut bien aussi ! !!!

acidparadouze
acidparadouze
Niveau 10
13 février 2003 à 11:19:19

Pour es applications windows ya le moyen propre a windows son API et des libraires(MFC,libs de borland...). Le blem c que je te deconseille vivement de tenter sans connaitre toutes tes bases du C et C++ sinon tu n´arriveras a rien. Parce franchement c´est assez casse-bonbon, enfin si tu veux quand meme regarder:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcemfc/htm/cwnd_44.asp
c le msdn de microsoft.
http://www.winprog.org/tutorial/ un super tutorial.

Ca devrait te suffir pour faire le tour de la question mais bon autant acheter un book : )

DCP3
DCP3
Niveau 6
13 février 2003 à 11:29:28

Tiens, j´étais en train de faire un TP, je te donne mes résultats:

  1. include <afxwin.h>

class IG1App : public CWinApp
{
public:
virtual BOOL InitInstance();
};

IG1App app;

  1. define ID_BUTTON1 100

class IG1Wnd : public CFrameWnd
{
CButton * button;
CPoint *LePoint;

public:
IG1Wnd();
~IG1Wnd();
afx_msg void ClicBouton();
afx_msg void OnPaint();

DECLARE_MESSAGE_MAP()

//moi amélioration
afx_msg void OnLButtonDblClk( UINT nFlags, CPoint point ) ;
void ShowMousePos(int x, int y);
afx_msg void OnLButtonUp( UINT nFlags, CPoint point ) ;
afx_msg void OnLButtonDown( UINT nFlags, CPoint point ) ;
void DrawLine(CDC *pDC, int x1, int y1, int x2, int y2);

};

BOOL IG1App::InitInstance()
{
m_pMainWnd = new IG1Wnd();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}

IG1Wnd::IG1Wnd()
{
Create(NULL, "IG1", WS_OVERLAPPEDWINDOW, CRect(0, 0, 200, 200));
button = new CButton();
button->Create("Click me", WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(50, 80, 150, 150), this, ID_BUTTON1);

LePoint = new CPoint();
LePoint->x = 0;
LePoint->y = 0;
}

IG1Wnd::~IG1Wnd()
{
delete button;
delete LePoint;
}

void IG1Wnd : :ClicBouton()
{
AfxMessageBox("Clic sur bouton") ;
}

void IG1Wnd : :OnPaint()
{
//le code de dessin
CRect r ;
GetClientRect(r);
CPaintDC dc(this);
CPen pen(PS_SOLID, 2, RGB(255,0,0)), *oldpen;
oldpen = dc.SelectObject(&);
dc.MoveTo(0, 0) ;
dc.LineTo(r.Width(), r.Height()) ;
dc.MoveTo(0, r.Height());
dc.LineTo(r.Width(), 0);
dc.SelectObject(oldpen);

//un peu de fun
for(int i=0, j=0; i<r.Width(); j+=10, i+=10)
{
dc.MoveTo(i, j) ;
dc.LineTo(i, r.Height()) ;
}

//cela ne fonctionne pas, comprendre pourquoi

button->SetWindowPos(this,r.Width()/2,r.Height()/
2,150,150,SWP_FRAMECHANGED);

}

BEGIN_MESSAGE_MAP(IG1Wnd, CFrameWnd)
ON_BN_CLICKED(ID_BUTTON1, ClicBouton)
ON_WM_PAINT()

//autres nouveautés
ON_WM_LBUTTONDBLCLK()
ON_WM_LBUTTONUP()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()

//nouveauté pour que les exercices soient resolues
void IG1Wnd : :OnLButtonDblClk( UINT nFlags, CPoint point )
{
//AfxMessageBox("Clic") ;
ShowMousePos(point.x, point.y);
}

void IG1Wnd::ShowMousePos(int x, int y)
{
char s[255];
sprintf(s, "%d %d ", x, y);
CRect r;
GetClientRect(r);
CClientDC dc(this);
dc.TextOut(r.Width()/2, r.Height()/2, s);
}

void IG1Wnd::OnLButtonUp( UINT nFlags, CPoint point )
{
CPaintDC dc(this);

dc.MoveTo(0, 0) ;
dc.LineTo(50, 50) ;

DrawLine(&, 10,15,100,100);
}

void IG1Wnd::OnLButtonDown( UINT nFlags, CPoint point )
{

CClientDC dc(this);

dc.MoveTo( LePoint->x , LePoint->y) ;
LePoint->x = point.x;
LePoint->y = point.y;
dc.LineTo(point.x, point.y) ;

}

void IG1Wnd::DrawLine(CDC *pDC, int x1, int y1, int x2, int y2)
{
pDC->MoveTo(x1, y1);
pDC->LineTo(x2, y2);
}

nutspower
nutspower
Niveau 9
13 février 2003 à 13:06:46

sa marche po avec dev C ++ ?

Sous forums
  • Aide à l'achat Mac
  • Création de Jeux
  • Linux
  • Programmation
  • Création de sites web
  • Internet
  • Steam Deck
  • Macintosh
  • Hardware
La vidéo du moment