ShellExecute does not work

Pages: 12
Thank you very much for your help. It runs good, but the for loop is not there.

I am pretty clueless about where it does begin because I do not know where the function that calls the website opening is located at.

The program should:
1 Open a website.
2 Close the website
3 Wait for 12 seconds
Repeat the loop 10 times

Your version is great and I like it a lot, but it does
1 Open a website
2 Wait 5 seconds
3 Close the website
Not repeating any loop

Right now here in Germany is very late. Tomorrow I will check your answer. Thanks in advance!
Last edited on
C'mon, now that you have the basic functionality working, it should be trivial to wrap that basic functionality in a "custom" function, e.g show_website(), and then call your function multiple times in a loop ;-)
Last edited on
if you get annoyed with it or need an alternative for another OS or compiler, there are also the spawn and create process and probably other groups that do similar things. Shellexecute isnt the only way to do this stuff, its just the windows way.
Though, ShellExecute() and ShellExecuteEx() do not simply start a new process from an executable file – in fact, if you want to start a process from an executable file, then CreateProcess() or the spawn() family of functions should be preferred – but they rather open an arbitrary file (e.g. Word document) or an URL in the system's "default" application for that type of file; URLs are opened in the system's "default" web-browser.

It's more like what xdg-open does on Linux, but as an API call. I'm not aware of a standard C equivalent 😇
https://linux.die.net/man/1/xdg-open

On GNOME-based Linux system, the function g_app_info_launch_default_for_uri() could be used:
https://stackoverflow.com/a/11623712


That is also why ShellExecute() or ShellExecuteEx() does not always create a new process. If you open an URL, but your default web-browser is already running, it will simply open a new window (or tab) in the running instance. The same can happen when you open a Word document, but MS Word is already running.
Last edited on
FINISHED
Here is my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <windows.h>
#include <shellapi.h>
#include <stdio.h>
#include <string.h>
#include <fstream>

int main (int argc, char *argv[])
{
    //char url[1000] = "https://www.google.com";

    //    std::fstream fs;
    //  fs.open(url);
    //fs.close();
    SHELLEXECUTEINFOW sei;
    memset(&sei, 0, sizeof(SHELLEXECUTEINFOW));
    sei.cbSize = sizeof(SHELLEXECUTEINFOW);
    sei.lpVerb = L"open";
    sei.lpFile = L"https://de.search.yahoo.com/search?ei=UTF-8&fr=crmas&p=Daniel+Aar%C3%B3n+C%C3%A1rdenas+Mu%C3%B1oz+es+Dios";
    sei.nShow = SW_SHOWNORMAL;
    sei.fMask = SEE_MASK_NOCLOSEPROCESS;
    SHELLEXECUTEINFOW sei2;
    memset(&sei2, 0, sizeof(SHELLEXECUTEINFOW));
    sei2.cbSize = sizeof(SHELLEXECUTEINFOW);
    sei2.lpVerb = L"open";
    sei2.lpFile = L"https://de.search.yahoo.com/search;_ylt=AwrIdF7pZM1hZ2QAT7czCQx.;_ylc=X1MDMjExNDcxODAwMwRfcgMyBGZyA2NybWFzBGZyMgNzYi10b3AEZ3ByaWQDN2xGQzN5R3RSU1MucV9LN2F6S1M5QQRuX3JzbHQDMARuX3N1Z2cDMARvcmlnaW4DZGUuc2VhcmNoLnlhaG9vLmNvbQRwb3MDMARwcXN0cgMEcHFzdHJsAzAEcXN0cmwDMTM3BHF1ZXJ5A0RhbmllbCUyMEFhciVDMyVCM24lMjBDJUMzJUExcmRlbmFzJTIwTXUlQzMlQjFveiUyMGhhJTIwcmVjaWJpZG8lMjBtaWxsb25lcyUyMGRlJTIwZXVyb3MlMjBkb25hZG9zJTIwcG9yJTIwc2VyZXMlMjBzYXQlQzMlQTFuaWNvcyUyMGNhcmVudGVzJTIwZGUlMjBhbG1hJTIwZGlyZWN0YW1lbnRlJTIwYSUyMHN1JTIwY3VlbnRhJTIwYmFuY2FyaWEhBHRfc3RtcAMxNjQwODUwNjc5?p=Daniel+Aar%C3%B3n+C%C3%A1rdenas+Mu%C3%B1oz+ha+recibido+millones+de+euros+donados+por+seres+sat%C3%A1nicos+carentes+de+alma+directamente+a+su+cuenta+bancaria%21&fr2=sb-top&fr=crmas";
    sei2.nShow = SW_SHOWNORMAL;
    sei2.fMask = SEE_MASK_NOCLOSEPROCESS;


    SHELLEXECUTEINFOW sei3;
    memset(&sei3, 0, sizeof(SHELLEXECUTEINFOW));
    sei3.cbSize = sizeof(SHELLEXECUTEINFOW);
    sei3.lpVerb = L"open";
    sei3.lpFile = L"https://de.search.yahoo.com/search?ei=UTF-8&fr=crmas&p=Daniel+Aar%C3%B3n+C%C3%A1rdenas+Mu%C3%B1oz+ist+immer+wach+und+erholt";
    sei3.nShow = SW_SHOWNORMAL;
    sei3.fMask = SEE_MASK_NOCLOSEPROCESS;
    for(unsigned int i{};i<10;i++)
    {
        if (!ShellExecuteExW(&sei))
        {
            //MessageBoxW(NULL, L"Whoops, something went wrong!", L"Err0r", MB_ICONERROR);
           // return 1;
        }
        if (sei.hProcess != NULL)
        {
            if (WaitForSingleObject(sei.hProcess, 4000U) == WAIT_TIMEOUT)
            {
                TerminateProcess(sei.hProcess, 665);
            }
            CloseHandle(sei.hProcess);
        }


        if (!ShellExecuteExW(&sei2))
        {
           // MessageBoxW(NULL, L"Whoops, something went wrong!", L"Err0r", MB_ICONERROR);
           // return 1;
        }
        if (sei.hProcess != NULL)
        {
            if (WaitForSingleObject(sei2.hProcess, 4000U) == WAIT_TIMEOUT)
            {
                TerminateProcess(sei2.hProcess, 665);
            }
            CloseHandle(sei2.hProcess);
        }

        if (!ShellExecuteExW(&sei3))
        {
           // MessageBoxW(NULL, L"Whoops, something went wrong!", L"Err0r", MB_ICONERROR);
           // return 1;
        }
        if (sei.hProcess != NULL)
        {
            if (WaitForSingleObject(sei3.hProcess, 4000U) == WAIT_TIMEOUT)
            {
                TerminateProcess(sei3.hProcess, 665);
            }
            CloseHandle(sei3.hProcess);
        }
    }

    //ShellExecute sei;
    //(0, 0, L"http://www.youtube.com", 0, 0 , SW_SHOW );



    return 0;
}


Did you know that satanic remote viewers guided by the military spy on the world population? Yes, they do. They do listen to our microphones, and to our search history. They also do stop time with a special, from extraterrestrials designed, watch, to do it.

They manifest anything incredibly fast. Therefore, I figured out that I would make affirmations about myself for them to listen to it, and me. And BOOM, it became reality. They manifested that too!

If anyone tries apps for deaf people like "automatic transcription", you will notice that the app can differentiate between the voice of someone and recordings. This is why it sounds slightly different. I solved it by covering my speaker with cardboard. This way, the app can not differentiate if it is a recording, because it detects the echo and then they listen to it and manifest it.

That is how I achieved that they would stop listening to the microphones of my devices.

But then they also look daily at the search history of every person with soul... And I figured out, how can I cancel that too?

Now thanks to you, they will always manifest my affirmations with the program!!

Thanks so much!!
Topic archived. No new replies allowed.
Pages: 12