Qual é a maneira correta de usar ShellExecute () em C para abrir um .txt

Tudo bem, então eu preciso abrir um arquivo .txt que será criado no mesmo arquivo que o programa.

Eu gostaria de usar ShellExecute (); para fazer isso e eu tenho feito muita pesquisa sobre isso e eu só não consigo obter a sintaxe correta principalmente porque eu não sei o que fazer com o parâmetro "HWND"

eu olheiAqui para as respostas e tenho todas as informações, exceto o que colocar no HWND

Aqui está como eu preciso do código usado:

ShellExecute(0,"open","c:\\debug.txt",NULL,NULL,1);

Obrigado antecipadamente pela ajuda perguntar se você não tem certeza do que eu estou falando! :)

Este é o programa que eu uso para testar a função:

  #include "DAL.h"
//DAL.h added to Testing file to make compiling easier
//Created to test show_debug()
int main(void)
{
  int test1,test2,final;

  puts("Enter 2 numbers to add (2,2)");
  scanf("%d,%d",&test1,&test2);

  log_debug(test1);
  log_debug(test2);

  view_debug();

  final= test1+test2;
  printf("%d\n",final);

  log_debug(final);

  return(0);
}

view_debug (); é a função que inclui o ShellExecute

void view_debug(void)//WIP
//Opens the debug.txt in notepad
{
    LoadLibrary( "shell32.dll" );
    ShellExecute(0,"open","c:\\debug.txt",NULL,NULL,1);
}

Isso é log_debug ();

int log_debug(int test_variable)
//This function simply tests the programmers desired veriable & displays it for help in keeping track of a veriables value(integer).
//The function has support for upto 1 variable for testing
{
    time_t now;
    time(&now);

    FILE *debug; //Creates file to write debug info

    debug=fopen("debug.txt", "a+");
    fprintf(debug,"DEBUG %.24s: <%d>\n", ctime(&now),test_variable);
    //TODO: Allow more than one variable

    fclose(debug);

    return(0);
}

O arquivo é criado pela função log_debug (); e funciona, mas deve ser aberto manualmente porque o ShellExecute não funciona.

Fonte completaAqui.

questionAnswers(4)

yourAnswerToTheQuestion