Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Form does not accept childs

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Wed Feb 20, 2019 9:11 am    Post subject: Form does not accept childs Reply with quote

I'm trying to create a window inside the form but I'm not getting it.
Code:
SetParent((HWND)this->Handle.ToInt32(), FindWindowA(NULL, "UDF1"));

If instead of UDF1 I use the title of some window created by another program, everything works well.
I remember already doing something similar in some previous version of cheat engine and funciounou.
this-> Handle is the identify of a .NET window
I also tried to create a button in the form of CE using the api of windows and also did not work.

Edit: Being more specific, why does a code like this not work when the window is the CE form?
Code:
#include <Windows.h>
#include <iostream>

int main() {
   HWND hwnd = FindWindowA(NULL, "UDF1");
   MSG msg;
   //if you add WS_CHILD flag,CreateWindow will fail because there is no parent window.
   HWND hWnd = CreateWindowA(TEXT("button"), TEXT("Easy"), WS_VISIBLE | WS_CHILD,
      10, 10, 80, 25, hwnd, NULL, (HINSTANCE)GetWindowLong(0, GWL_HINSTANCE), NULL);

   //ShowWindow(hWnd, SW_SHOW);
   //UpdateWindow(hWnd);
   std::cout << hwnd;
   while (GetMessage(&msg, NULL, 0, 0))
   {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
   }

   return (int)msg.wParam;
}


Problem solved: To create a child in the CE form, administrator permission is required.

_________________
...


Last edited by Filipe_Br on Wed Feb 20, 2019 3:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Wed Feb 20, 2019 12:07 pm    Post subject: Reply with quote

i suggest you read a little bit more about windows programming, you need to register a class, provide the address of window procedure to handle the messages.

and you cant create a button without a main window, you can however create a parent window without minimize, maximize, and close boxes and set your button size to the size of client window.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Wed Feb 20, 2019 12:23 pm    Post subject: Reply with quote

I think the problem is not with my code, see this video.
https://www.youtube.com/watch?v=-2tZxWgI4NY

_________________
...
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Wed Feb 20, 2019 12:32 pm    Post subject: Reply with quote

compile that UDF1 form into a standalone executable.
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Wed Feb 20, 2019 12:36 pm    Post subject: Reply with quote

I think you still do not understand what I'm trying to do.
I'm trying to create a plugin for Cheat Engine, to add the Windows Media Player component.
As you saw in the video I can create a window with Windows Media Player. And I can also make this window be the daughter of other windows of other processes. But for some reason when I try in the Cheat Engine form window it does not work.

Edit: And that script that just creates a button, I already managed to make that button appear in the Cheat Engine form at a time ago. But I no longer have the code I used at the time.

_________________
...
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Wed Feb 20, 2019 5:59 pm    Post subject: Reply with quote

use IUP or xavante or LuaTool Kit
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Thu Feb 21, 2019 1:22 am    Post subject: Reply with quote

i did understand, but i cant help you.
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites