Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Dashboard interna (incompleta)  (Visto 1657 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline plyn Posteado: July 07, 2024, 05:35:02 PM | Modificado: July 08, 2024, 02:01:55 PM by ZabiinoOo

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 246
  • Gracias recibida: 731
  • br
PRINT:


main.h
Code: [Select]
void GetCharacterName(char* nombre);

main.cpp

Code: [Select]
HWND hText = NULL;
char gCharacterName[256];
HWND hSecondaryWindow = NULL;
HFONT hFontVerdana = NULL;
HCURSOR hCursor = NULL; //dont work

--------------------------------------------------------------------------------
void GetCharacterName(char* nombre) {
switch(*(DWORD*)(MAIN_SCREEN_STATE))
{
case 1:
wsprintf(nombre, "Carregando...");
break;
case 2:
wsprintf(nombre, "Selecionando Servidor...");
break;
case 3:
wsprintf(nombre, "Carregando Informações do Character...");
break;
case 4:
wsprintf(nombre, "Escolhendo Personagem...");
break;
case 5:
wsprintf(nombre, "Personagem: %s | Level: %d Resets: %d", (char*)(*(DWORD*)(MAIN_CHARACTER_STRUCT)+0x00), *(WORD*)(*(DWORD*)(MAIN_CHARACTER_STRUCT)+0x0E), ViewReset); // Edite as offsets de acordo com o main que irá utilizar
break;
default:
wsprintf(nombre, "Estado Desconhecido"); // Tratamento para estados não previstos
break;
}

}
-----------------------------------------------------------------------



// Procedimento da janela secundária
LRESULT CALLBACK SecondaryWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch (uMsg) {
case WM_CREATE:
// Configurar o controle de texto (STATIC)
hText = CreateWindow(_T("STATIC"), _T(""),
WS_VISIBLE | WS_CHILD | WS_BORDER | SS_CENTER,
10, 10, 320, 30, hwnd, NULL, ((LPCREATESTRUCT)lParam)->hInstance, NULL);

// Criar a fonte Verdana
hFontVerdana = CreateFont(
15,                        // Altura da fonte
0,                         // Largura da fonte
0,                         // Ângulo de escapamento
0,                         // Ângulo de orientação
FW_NORMAL,                 // Peso da fonte
FALSE,                     // Itálico
FALSE,                     // Sublinhado
FALSE,                     // Tachado
DEFAULT_CHARSET,           // Conjunto de caracteres
OUT_DEFAULT_PRECIS,        // Precisão de saída
CLIP_DEFAULT_PRECIS,       // Precisão de recorte
DEFAULT_QUALITY,           // Qualidade de saída
DEFAULT_PITCH | FF_SWISS,  // Pitch e família da fonte
_T("Verdana"));            // Nome da fonte

// Aplicar a fonte Verdana ao controle de texto
SendMessage(hText, WM_SETFONT, (WPARAM)hFontVerdana, TRUE);

// Configurar um temporizador que dispara a cada 1000 milissegundos (1 segundo)
SetTimer(hwnd, 1, 1000, NULL);

return 0;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);

// Desenhar o nome do personagem na janela
TextOut(hdc, 10, 10, gCharacterName, strlen(gCharacterName));

EndPaint(hwnd, &ps);
return 0;
}
case WM_TIMER:
// Atualizar o nome do personagem automaticamente
GetCharacterName(gCharacterName);
SetWindowText(hText, gCharacterName);
return 0;
case WM_CLOSE:
ShowWindow(hwnd, SW_HIDE); // Esconde a janela ao invés de destruí-la
return 0;
case WM_DESTROY:
if (hSecondaryWindow) {
DestroyWindow(hSecondaryWindow);
}
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}

// Função para criar a janela secundária
void CreateSecondaryWindow(HINSTANCE hInstance) {
WNDCLASS wndClass = { 0 };
wndClass.lpfnWndProc = SecondaryWindowProc;
wndClass.hInstance = hInstance;
wndClass.lpszClassName = _T("SecondaryWindowClass");
// Carregar um cursor personalizado
hCursor = LoadCursor(NULL, IDC_HAND); // Substitua IDC_HAND pelo cursor desejado ou use LoadCursorFromFile para um arquivo de cursor personalizado
wndClass.hCursor = hCursor;


RegisterClass(&wndClass);

// Obter a resolução da tela
RECT desktop;
GetWindowRect(GetDesktopWindow(), &desktop);

// Definir a posição no canto inferior direito
int width = 355;
int height = 500;
int x = desktop.right - width;
int y = desktop.bottom - height;

hSecondaryWindow = CreateWindow(_T("SecondaryWindowClass"), _T("MuHorizon"),
WS_OVERLAPPEDWINDOW, x, y, width, height,
NULL, NULL, hInstance, NULL);

if (hSecondaryWindow) {

char nombre[20];

// Chamar a função para obter o nome do personagem
GetCharacterName(nombre);





if (hText) {
ShowWindow(hText, SW_SHOW);
UpdateWindow(hText);

// Inicialmente, obtenha o nome do personagem e defina o texto do controle STATIC
GetCharacterName(gCharacterName);
SetWindowText(hText, gCharacterName);
}

if (hSecondaryWindow) {
ShowWindow(hSecondaryWindow, SW_SHOW);
UpdateWindow(hSecondaryWindow);

// Inicialmente, obtenha o nome do personagem e defina o texto do controle STATIC
GetCharacterName(gCharacterName);
SetWindowText(hText, gCharacterName);
}
return;
}
}


DLL_PROCESS_ATTACH:
CreateSecondaryWindow((HINSTANCE)hModule);

case DLL_PROCESS_DETACH:
if (hSecondaryWindow) {
DestroyWindow(hSecondaryWindow);
}

Hisashiburi dana, Mugiwara!

Gracias:


Offline gambasoxd #1 Posteado: July 26, 2024, 02:40:01 PM

  • 0 puntos por ventas
  • *
  • Rank: Destacado
  • Posts: 86
  • Gracias recibida: 2186
  • pe
Hola duda existencial, de donde sacas estas variables y/o funciones :D

_T()
ViewReset

Para cualquier consulta aqui dejo mi información:

CONTACTO

Offline Ryzenn #2 Posteado: July 26, 2024, 02:55:57 PM

  • Colaborador
  • +1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 288
  • Gracias recibida: 4670
  • ar
Hola duda existencial, de donde sacas estas variables y/o funciones :D

_T()
ViewReset
Print Player

Se tu mismo, lo demás lo vas aprendiendo por el camino.

Offline thziin #3 Posteado: July 27, 2024, 09:55:04 PM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 15
  • Gracias recibida: 3
  • br
Hola duda existencial, de donde sacas estas variables y/o funciones :D

_T()
ViewReset

// Biblioteca
#include <tchar.h >


Offline plyn #4 Posteado: July 27, 2024, 09:57:41 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 246
  • Gracias recibida: 731
  • br
Hola duda existencial, de donde sacas estas variables y/o funciones :D

_T()
ViewReset


#include "PrintPlayer.h"

Hisashiburi dana, Mugiwara!

Offline dakosmu #5 Posteado: July 27, 2024, 11:09:59 PM | Modificado: July 27, 2024, 11:14:15 PM by dakosmu

  • Colaborador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 774
  • Gracias recibida: 11054
  • ve
Dejare este codigo aqui . Ojala alguien lo comparta mejor






 blush

Dakosmu Colaborador

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
21 Replies
6298 Views
Last post June 12, 2024, 06:17:31 PM
by vitinho2119
6 Replies
4923 Views
Last post September 18, 2022, 05:39:47 AM
by OmnitrickS
1 Replies
1181 Views
Last post March 15, 2023, 09:35:56 AM
by yhoon
0 Replies
422 Views
Last post May 10, 2023, 04:22:18 PM
by bafta100
1 Replies
1057 Views
Last post October 22, 2023, 07:20:16 AM
by maxig